mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
fixes #933
This commit is contained in:
@@ -671,14 +671,11 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
of opcLtu:
|
||||
decodeBC(rkInt)
|
||||
regs[ra].intVal = ord(regs[rb].intVal <% regs[rc].intVal)
|
||||
of opcEqRef:
|
||||
of opcEqRef, opcEqNimrodNode:
|
||||
decodeBC(rkInt)
|
||||
regs[ra].intVal = ord((regs[rb].node.kind == nkNilLit and
|
||||
regs[rc].node.kind == nkNilLit) or
|
||||
regs[rb].node == regs[rc].node)
|
||||
of opcEqNimrodNode:
|
||||
decodeBC(rkInt)
|
||||
regs[ra].intVal = ord(regs[rb].node == regs[rc].node)
|
||||
of opcXor:
|
||||
decodeBC(rkInt)
|
||||
regs[ra].intVal = ord(regs[rb].intVal != regs[rc].intVal)
|
||||
|
||||
@@ -6,7 +6,10 @@ f
|
||||
TTaa
|
||||
TTaa
|
||||
TTaa
|
||||
TTaa'''
|
||||
TTaa
|
||||
true
|
||||
true
|
||||
nil'''
|
||||
|
||||
output: '''test'''
|
||||
"""
|
||||
@@ -62,3 +65,16 @@ macro m(s:static[Td]) : stmt =
|
||||
const s=("TT", 3)
|
||||
m(s)
|
||||
m(s)
|
||||
|
||||
# bug #933
|
||||
|
||||
proc nilcheck(): PNimrodNode {.compileTime.} =
|
||||
echo(result == nil) # true
|
||||
echo(result.isNil) # true
|
||||
echo(repr(result)) # nil
|
||||
|
||||
macro testnilcheck(): stmt =
|
||||
result = newNimNode(nnkStmtList)
|
||||
discard nilcheck()
|
||||
|
||||
testnilcheck()
|
||||
|
||||
Reference in New Issue
Block a user