Merge pull request #3651 from jangko/vm_'excl'
fixed compile time `excl ` cause SIGSEGV #3639
This commit is contained in:
commit
86bb9d8b47
2 changed files with 28 additions and 1 deletions
|
|
@ -618,7 +618,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
addSon(regs[ra].node, r.copyTree)
|
addSon(regs[ra].node, r.copyTree)
|
||||||
of opcExcl:
|
of opcExcl:
|
||||||
decodeB(rkNode)
|
decodeB(rkNode)
|
||||||
var b = newNodeIT(nkCurly, regs[rb].node.info, regs[rb].node.typ)
|
var b = newNodeIT(nkCurly, regs[ra].node.info, regs[ra].node.typ)
|
||||||
addSon(b, regs[rb].regToNode)
|
addSon(b, regs[rb].regToNode)
|
||||||
var r = diffSets(regs[ra].node, b)
|
var r = diffSets(regs[ra].node, b)
|
||||||
discardSons(regs[ra].node)
|
discardSons(regs[ra].node)
|
||||||
|
|
|
||||||
27
tests/vm/texcl.nim
Normal file
27
tests/vm/texcl.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
discard """
|
||||||
|
output: '''false'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
import macros
|
||||||
|
|
||||||
|
type
|
||||||
|
nlOptions = enum
|
||||||
|
nloNone
|
||||||
|
nloDebug
|
||||||
|
|
||||||
|
var nlOpts {.compileTime.} = {nloDebug}
|
||||||
|
|
||||||
|
proc initOpts(): set[nlOptions] =
|
||||||
|
result.incl nloDebug
|
||||||
|
result.incl nloNone
|
||||||
|
result.excl nloDebug
|
||||||
|
|
||||||
|
const cOpts = initOpts()
|
||||||
|
|
||||||
|
macro nlo(): stmt =
|
||||||
|
nlOpts.incl(nloNone)
|
||||||
|
nlOpts.excl(nloDebug)
|
||||||
|
result = newEmptyNode()
|
||||||
|
|
||||||
|
nlo()
|
||||||
|
echo nloDebug in cOpts
|
||||||
Loading…
Add table
Add a link
Reference in a new issue