fixes #12244 [backport]
This commit is contained in:
parent
3b1760df72
commit
7f904e2c66
2 changed files with 20 additions and 1 deletions
|
|
@ -710,7 +710,6 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of rkNode:
|
of rkNode:
|
||||||
if regs[ra].node.kind == nkNilLit:
|
if regs[ra].node.kind == nkNilLit:
|
||||||
stackTrace(c, tos, pc, errNilAccess)
|
stackTrace(c, tos, pc, errNilAccess)
|
||||||
assert nfIsRef in regs[ra].node.flags
|
|
||||||
regs[ra].node[] = regs[rc].regToNode[]
|
regs[ra].node[] = regs[rc].regToNode[]
|
||||||
regs[ra].node.flags.incl nfIsRef
|
regs[ra].node.flags.incl nfIsRef
|
||||||
else: stackTrace(c, tos, pc, errNilAccess)
|
else: stackTrace(c, tos, pc, errNilAccess)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
discard """
|
discard """
|
||||||
output: '''[127, 127, 0, 255]
|
output: '''[127, 127, 0, 255]
|
||||||
[127, 127, 0, 255]
|
[127, 127, 0, 255]
|
||||||
|
|
||||||
|
(data: 1)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
nimout: '''caught Exception
|
nimout: '''caught Exception
|
||||||
|
|
@ -180,3 +182,21 @@ static:
|
||||||
var stream = initCtsStream(file)
|
var stream = initCtsStream(file)
|
||||||
parseAtlas(stream)
|
parseAtlas(stream)
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
||||||
|
|
||||||
|
# bug #12244
|
||||||
|
|
||||||
|
type
|
||||||
|
Apple = object
|
||||||
|
data: int
|
||||||
|
|
||||||
|
func what(x: var Apple) =
|
||||||
|
x = Apple(data: 1)
|
||||||
|
|
||||||
|
func oh_no(): Apple =
|
||||||
|
what(result)
|
||||||
|
|
||||||
|
const
|
||||||
|
vmCrash = oh_no()
|
||||||
|
|
||||||
|
debugEcho vmCrash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue