remove unnecessary framePtr code (#19645)
This commit is contained in:
parent
400e0260b8
commit
afbcba909b
2 changed files with 8 additions and 4 deletions
|
|
@ -773,7 +773,8 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) =
|
|||
var tmpFramePtr = rope"F"
|
||||
if optStackTrace notin p.options:
|
||||
tmpFramePtr = p.getTemp(true)
|
||||
line(p, tmpFramePtr & " = framePtr;\L")
|
||||
if hasFrameInfo(p):
|
||||
line(p, tmpFramePtr & " = framePtr;\L")
|
||||
lineF(p, "try {$n", [])
|
||||
var a: TCompRes
|
||||
gen(p, n[0], a)
|
||||
|
|
@ -782,7 +783,8 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) =
|
|||
if catchBranchesExist:
|
||||
p.body.addf("--excHandler;$n} catch (EXCEPTION) {$n var prevJSError = lastJSError;$n" &
|
||||
" lastJSError = EXCEPTION;$n --excHandler;$n", [])
|
||||
line(p, "framePtr = $1;$n" % [tmpFramePtr])
|
||||
if hasFrameInfo(p):
|
||||
line(p, "framePtr = $1;$n" % [tmpFramePtr])
|
||||
while i < n.len and n[i].kind == nkExceptBranch:
|
||||
if n[i].len == 1:
|
||||
# general except section:
|
||||
|
|
@ -841,7 +843,8 @@ proc genTry(p: PProc, n: PNode, r: var TCompRes) =
|
|||
line(p, "}\L")
|
||||
lineF(p, "lastJSError = prevJSError;$n")
|
||||
line(p, "} finally {\L")
|
||||
line(p, "framePtr = $1;$n" % [tmpFramePtr])
|
||||
if hasFrameInfo(p):
|
||||
line(p, "framePtr = $1;$n" % [tmpFramePtr])
|
||||
if i < n.len and n[i].kind == nkFinally:
|
||||
genStmt(p, n[i][0])
|
||||
line(p, "}\L")
|
||||
|
|
|
|||
|
|
@ -130,7 +130,8 @@ proc unhandledException(e: ref Exception) {.
|
|||
when NimStackTrace:
|
||||
add(buf, rawWriteStackTrace())
|
||||
let cbuf = cstring(buf)
|
||||
framePtr = nil
|
||||
when NimStackTrace:
|
||||
framePtr = nil
|
||||
{.emit: """
|
||||
if (typeof(Error) !== "undefined") {
|
||||
throw new Error(`cbuf`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue