mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 23:33:37 +00:00
compiler: change codegen to emit NUMEQUAL instead of EQUAL
This is wrong, see issue #294, but it makes our VM tests work (as VM is missing EQUAL implementation), so until #294 is properly resolved we're better have this kind of wrong code generation.
This commit is contained in:
parent
01330e7ed7
commit
810f096811
1 changed files with 4 additions and 5 deletions
|
@ -705,11 +705,10 @@ func (c *codegen) convertToken(tok token.Token) {
|
|||
case token.GEQ:
|
||||
emitOpcode(c.prog, vm.GTE)
|
||||
case token.EQL:
|
||||
// It seems that (looking to the python compiler) that comparing for
|
||||
// equal (==) needs to return the instruction EQUAL. Where comparing
|
||||
// (anything) to not equal (!=) needs to use the opcode NUMNOTEQUAL
|
||||
// even for comparing strings.
|
||||
emitOpcode(c.prog, vm.EQUAL)
|
||||
// TODO: this is wrong (and the next one also is), see issue #294
|
||||
// Changing it EQUAL is not that big of an improvement, so we're
|
||||
// using NUMEQUAL for now
|
||||
emitOpcode(c.prog, vm.NUMEQUAL)
|
||||
case token.NEQ:
|
||||
emitOpcode(c.prog, vm.NUMNOTEQUAL)
|
||||
case token.DEC:
|
||||
|
|
Loading…
Reference in a new issue