mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-11 22:08:54 +00:00
fixes #25446
supports this since `static: discard cast[pointer](nil)` works
(cherry picked from commit 39864980d1)
This commit is contained in:
@@ -663,7 +663,10 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||
of rkNode:
|
||||
if regs[rb].node.typ.kind notin PtrLikeKinds:
|
||||
stackTrace(c, tos, pc, "opcCastIntToPtr: regs[rb].node.typ: " & $regs[rb].node.typ.kind)
|
||||
node2.intVal = regs[rb].node.intVal
|
||||
if regs[rb].node.kind == nkNilLit:
|
||||
node2.intVal = 0
|
||||
else:
|
||||
node2.intVal = regs[rb].node.intVal
|
||||
else: stackTrace(c, tos, pc, "opcCastIntToPtr: regs[rb].kind: " & $regs[rb].kind)
|
||||
regs[ra].node = node2
|
||||
of opcAsgnComplex:
|
||||
|
||||
@@ -814,6 +814,8 @@ static:
|
||||
conf.val = 2
|
||||
foo2323(defaultConf)
|
||||
|
||||
discard cast[pointer](default(pointer)) # bug #25446
|
||||
|
||||
|
||||
proc g1314(_: static bool) = discard
|
||||
proc g1314(_: int) = discard
|
||||
|
||||
Reference in New Issue
Block a user