mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
maybe so...
This commit is contained in:
@@ -858,12 +858,28 @@ proc genRaiseStmt(p: BProc, t: PNode) =
|
||||
of excCpp:
|
||||
blockLeaveActions(p, howManyTrys = 0, howManyExcepts = p.inExceptBlockLen)
|
||||
of excGoto:
|
||||
var inExcept = 0
|
||||
for i in 0..<p.nestedTryStmts.len:
|
||||
if p.nestedTryStmts[i].inExcept:
|
||||
inExcept = 1
|
||||
break
|
||||
blockLeaveActions(p, howManyTrys = 0, howManyExcepts = inExcept)
|
||||
#[
|
||||
There is a difference between:
|
||||
|
||||
try:
|
||||
something()
|
||||
except:
|
||||
# bug #25037
|
||||
try:
|
||||
let tmp = someValue()
|
||||
raise E(tmp)
|
||||
finally:
|
||||
destroy(tmp)
|
||||
|
||||
And:
|
||||
|
||||
try:
|
||||
something()
|
||||
except:
|
||||
raise E
|
||||
]#
|
||||
if noSafePoints notin p.flags:
|
||||
p.s(cpsStmts).addCallStmt(cgsymValue(p.module, "popAllButOneCurrentExceptions"))
|
||||
else:
|
||||
discard
|
||||
genLineDir(p, t)
|
||||
|
||||
@@ -158,6 +158,10 @@ proc popCurrentException {.compilerRtl, inl.} =
|
||||
currException = currException.up
|
||||
#showErrorMessage2 "B"
|
||||
|
||||
proc popAllButOneCurrentExceptions {.compilerRtl, inl.} =
|
||||
while currException != nil and currException.up != nil:
|
||||
currException = currException.up
|
||||
|
||||
proc popCurrentExceptionEx(id: uint) {.compilerRtl.} =
|
||||
discard "only for bootstrapping compatbility"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user