fixes #10547
This commit is contained in:
parent
d46a590f74
commit
f0e6becc23
1 changed files with 6 additions and 5 deletions
|
|
@ -1429,7 +1429,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNGetType:
|
of opcNGetType:
|
||||||
let rb = instr.regB
|
let rb = instr.regB
|
||||||
let rc = instr.regC
|
let rc = instr.regC
|
||||||
case rc:
|
case rc
|
||||||
of 0:
|
of 0:
|
||||||
# getType opcode:
|
# getType opcode:
|
||||||
ensureKind(rkNode)
|
ensureKind(rkNode)
|
||||||
|
|
@ -1471,7 +1471,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
createStr regs[ra]
|
createStr regs[ra]
|
||||||
let a = regs[rb].node
|
let a = regs[rb].node
|
||||||
case a.kind
|
case a.kind
|
||||||
of {nkStrLit..nkTripleStrLit}:
|
of nkStrLit..nkTripleStrLit:
|
||||||
regs[ra].node.strVal = a.strVal
|
regs[ra].node.strVal = a.strVal
|
||||||
of nkCommentStmt:
|
of nkCommentStmt:
|
||||||
regs[ra].node.strVal = a.comment
|
regs[ra].node.strVal = a.comment
|
||||||
|
|
@ -1573,7 +1573,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
var bStrVal: cstring = nil
|
var bStrVal: cstring = nil
|
||||||
# extract strVal from argument ``a``
|
# extract strVal from argument ``a``
|
||||||
case aNode.kind
|
case aNode.kind
|
||||||
of {nkStrLit..nkTripleStrLit}:
|
of nkStrLit..nkTripleStrLit:
|
||||||
aStrVal = aNode.strVal.cstring
|
aStrVal = aNode.strVal.cstring
|
||||||
of nkIdent:
|
of nkIdent:
|
||||||
aStrVal = aNode.ident.s.cstring
|
aStrVal = aNode.ident.s.cstring
|
||||||
|
|
@ -1585,7 +1585,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
discard
|
discard
|
||||||
# extract strVal from argument ``b``
|
# extract strVal from argument ``b``
|
||||||
case bNode.kind
|
case bNode.kind
|
||||||
of {nkStrLit..nkTripleStrLit}:
|
of nkStrLit..nkTripleStrLit:
|
||||||
bStrVal = bNode.strVal.cstring
|
bStrVal = bNode.strVal.cstring
|
||||||
of nkIdent:
|
of nkIdent:
|
||||||
bStrVal = bNode.ident.s.cstring
|
bStrVal = bNode.ident.s.cstring
|
||||||
|
|
@ -1598,7 +1598,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
# set result
|
# set result
|
||||||
regs[ra].intVal =
|
regs[ra].intVal =
|
||||||
if aStrVal != nil and bStrVal != nil:
|
if aStrVal != nil and bStrVal != nil:
|
||||||
ord(idents.cmpIgnoreStyle(aStrVal,bStrVal,high(int)) == 0)
|
ord(idents.cmpIgnoreStyle(aStrVal, bStrVal, high(int)) == 0)
|
||||||
else:
|
else:
|
||||||
0
|
0
|
||||||
|
|
||||||
|
|
@ -1948,6 +1948,7 @@ const evalPass* = makePass(myOpen, myProcess, myClose)
|
||||||
proc evalConstExprAux(module: PSym;
|
proc evalConstExprAux(module: PSym;
|
||||||
g: ModuleGraph; prc: PSym, n: PNode,
|
g: ModuleGraph; prc: PSym, n: PNode,
|
||||||
mode: TEvalMode): PNode =
|
mode: TEvalMode): PNode =
|
||||||
|
if g.config.errorCounter > 0: return n
|
||||||
let n = transformExpr(g, module, n, noDestructors = true)
|
let n = transformExpr(g, module, n, noDestructors = true)
|
||||||
setupGlobalCtx(module, g)
|
setupGlobalCtx(module, g)
|
||||||
var c = PCtx g.vm
|
var c = PCtx g.vm
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue