Of operator in vm fixes [backport] (#9717)

* fixes #9701
*  fixes #9702
* optimize of statement to bool
This commit is contained in:
cooldome 2018-11-15 12:03:42 +00:00 • committed by Andreas Rumpf
commit 8c1083d3b7
6 changed files with 65 additions and 7 deletions

View file

@ -1228,7 +1228,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
of opcOf:
decodeBC(rkInt)
let typ = c.types[regs[rc].intVal.int]
regs[ra].intVal = ord(inheritanceDiff(regs[rb].node.typ, typ) >= 0)
regs[ra].intVal = ord(inheritanceDiff(regs[rb].node.typ, typ) <= 0)
of opcIs:
decodeBC(rkInt)
let t1 = regs[rb].node.typ.skipTypes({tyTypeDesc})