fix: store the result of a bin function call in frame

This commit is contained in:
Marc Vertes
2020-05-03 17:56:04 +02:00
committed by GitHub
parent e4acba031d
commit e12c8b72c4
2 changed files with 22 additions and 1 deletions

View File

@@ -933,13 +933,16 @@ func callBin(n *node) {
}
case fnext != nil:
// Handle branching according to boolean result.
index := n.findex
n.exec = func(f *frame) bltn {
in := make([]reflect.Value, l)
for i, v := range values {
in[i] = v(f)
}
res := value(f).Call(in)
if res[0].Bool() {
b := res[0].Bool()
f.data[index].SetBool(b)
if b {
return tnext
}
return fnext