parent
af1e84f54d
commit
84eab97fed
2 changed files with 29 additions and 3 deletions
|
|
@ -658,15 +658,16 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) =
|
||||||
line(p, "}\L")
|
line(p, "}\L")
|
||||||
|
|
||||||
proc genRaiseStmt(p: PProc, n: PNode) =
|
proc genRaiseStmt(p: PProc, n: PNode) =
|
||||||
genLineDir(p, n)
|
|
||||||
if n.sons[0].kind != nkEmpty:
|
if n.sons[0].kind != nkEmpty:
|
||||||
var a: TCompRes
|
var a: TCompRes
|
||||||
gen(p, n.sons[0], a)
|
gen(p, n.sons[0], a)
|
||||||
let typ = skipTypes(n.sons[0].typ, abstractPtrs)
|
let typ = skipTypes(n.sons[0].typ, abstractPtrs)
|
||||||
|
genLineDir(p, n)
|
||||||
useMagic(p, "raiseException")
|
useMagic(p, "raiseException")
|
||||||
lineF(p, "raiseException($1, $2);$n",
|
lineF(p, "raiseException($1, $2);$n",
|
||||||
[a.rdLoc, makeJSString(typ.sym.name.s)])
|
[a.rdLoc, makeJSString(typ.sym.name.s)])
|
||||||
else:
|
else:
|
||||||
|
genLineDir(p, n)
|
||||||
useMagic(p, "reraiseException")
|
useMagic(p, "reraiseException")
|
||||||
line(p, "reraiseException();\L")
|
line(p, "reraiseException();\L")
|
||||||
|
|
||||||
|
|
@ -856,6 +857,7 @@ proc genAsgnAux(p: PProc, x, y: PNode, noCopyNeeded: bool) =
|
||||||
else:
|
else:
|
||||||
gen(p, x, a)
|
gen(p, x, a)
|
||||||
|
|
||||||
|
genLineDir(p, y)
|
||||||
gen(p, y, b)
|
gen(p, y, b)
|
||||||
|
|
||||||
# we don't care if it's an etyBaseIndex (global) of a string, it's
|
# we don't care if it's an etyBaseIndex (global) of a string, it's
|
||||||
|
|
@ -892,11 +894,9 @@ proc genAsgnAux(p: PProc, x, y: PNode, noCopyNeeded: bool) =
|
||||||
lineF(p, "$1 = $2;$n", [a.res, b.res])
|
lineF(p, "$1 = $2;$n", [a.res, b.res])
|
||||||
|
|
||||||
proc genAsgn(p: PProc, n: PNode) =
|
proc genAsgn(p: PProc, n: PNode) =
|
||||||
genLineDir(p, n)
|
|
||||||
genAsgnAux(p, n.sons[0], n.sons[1], noCopyNeeded=false)
|
genAsgnAux(p, n.sons[0], n.sons[1], noCopyNeeded=false)
|
||||||
|
|
||||||
proc genFastAsgn(p: PProc, n: PNode) =
|
proc genFastAsgn(p: PProc, n: PNode) =
|
||||||
genLineDir(p, n)
|
|
||||||
# 'shallowCopy' always produced 'noCopyNeeded = true' here but this is wrong
|
# 'shallowCopy' always produced 'noCopyNeeded = true' here but this is wrong
|
||||||
# for code like
|
# for code like
|
||||||
# while j >= pos:
|
# while j >= pos:
|
||||||
|
|
|
||||||
26
tests/js/t7224.nim
Normal file
26
tests/js/t7224.nim
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
discard """
|
||||||
|
cmd: "nim $target $options --stackTrace:on --lineTrace:on $file"
|
||||||
|
outputsub: '''
|
||||||
|
t7224.aaa, line: 21
|
||||||
|
t7224.bbb, line: 18
|
||||||
|
t7224.ccc, line: 15
|
||||||
|
t7224.ddd, line: 12
|
||||||
|
'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
proc ddd() =
|
||||||
|
raise newException(IOError, "didn't do stuff")
|
||||||
|
|
||||||
|
proc ccc() =
|
||||||
|
ddd()
|
||||||
|
|
||||||
|
proc bbb() =
|
||||||
|
ccc()
|
||||||
|
|
||||||
|
proc aaa() =
|
||||||
|
bbb()
|
||||||
|
|
||||||
|
try:
|
||||||
|
aaa()
|
||||||
|
except IOError as e:
|
||||||
|
echo getStackTrace(e)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue