fix: use branch operation in || and && operators, fix storage for ! (#476)

This commit is contained in:
Marc Vertes
2020-01-07 17:27:22 +01:00
committed by Ludovic Fernandez
parent f3f54a5302
commit 9a8a88dcb9
5 changed files with 28 additions and 1 deletions

View File

@@ -345,13 +345,16 @@ func not(n *node) {
dest := genValue(n)
value := genValue(n.child[0])
tnext := getExec(n.tnext)
i := n.findex
if n.fnext != nil {
fnext := getExec(n.fnext)
n.exec = func(f *frame) bltn {
if !value(f).Bool() {
f.data[i].SetBool(true)
return tnext
}
f.data[i].SetBool(false)
return fnext
}
} else {