补充单 rune 转 string

This commit is contained in:
3dgen 2023-08-31 11:00:08 +08:00
parent d6c5c21a68
commit ab40ca7aec
1 changed files with 5 additions and 0 deletions

View File

@ -731,6 +731,11 @@ func (m *Module) EmitGenConvert(x Value, typ ValueType) (insts []wat.Inst) {
insts = append(insts, x.EmitPush()...)
insts = append(insts, wat.NewInstCall("runtime.stringFromRuneSlice"))
return
case xt.Equal(m.RUNE) || xt.Equal(m.I32):
insts = append(insts, x.EmitPush()...)
insts = append(insts, wat.NewInstCall("runtime.stringFromRune"))
return
}
case typ.Equal(m.BYTES):