mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-15 07:43:26 +00:00
fixed compile time excl cause SIGSEGV #3639
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user