fixed compile time excl cause SIGSEGV #3639
This commit is contained in:
parent
a3c8bb9376
commit
60a400eeb0
2 changed files with 28 additions and 1 deletions
|
|
@ -611,7 +611,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
|||
addSon(regs[ra].node, r.copyTree)
|
||||
of opcExcl:
|
||||
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)
|
||||
var r = diffSets(regs[ra].node, b)
|
||||
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