@@ -152,7 +152,7 @@ func (f *FuncExpr) Children() (ret []interface{}) {
merge = false
}
- if merge {
+ if merge && len(f.Params) > 0 {
ret = append(ret, mp)
} else {
for _, p := range tmp {
@@ -176,7 +176,7 @@ func (f *FuncExpr) Children() (ret []interface{}) {
+ if merge && len(f.Locals) > 0 {
ret = append(ret, ml)
for _, l := range tmp {
@@ -111,6 +111,10 @@ func TestValidation(t *testing.T) {
b := &ir.Block{}
poo(t, b)
+ l0 := &ir.Local{}
+ l0.Name("$i")
+ l0.Type(types.I64)
+ poo(t, l0)
/* надо проверить все сущности
Br
BrIf
@@ -132,7 +136,6 @@ func TestValidation(t *testing.T) {
IfExpr
Import
LoadExpr
- Local
Loop
Memory
Module