From d30694af8bce13011a6964efbd6e99fcfa2f83f7 Mon Sep 17 00:00:00 2001 From: "rogerl%netscape.com" Date: Wed, 30 Oct 2002 19:10:38 +0000 Subject: [PATCH] Fixed finally invocation. --- js2/src/js2engine.cpp | 1 - js2/src/js2engine.h | 3 +-- js2/src/js2op_flowcontrol.cpp | 14 +++++++------- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/js2/src/js2engine.cpp b/js2/src/js2engine.cpp index 25b33908a6f..a601a077d55 100644 --- a/js2/src/js2engine.cpp +++ b/js2/src/js2engine.cpp @@ -471,7 +471,6 @@ namespace MetaData { case eBracketDelete: return -1; // pop base and index, push boolean result - case eStop: case eReturnVoid: case eBranch: return 0; diff --git a/js2/src/js2engine.h b/js2/src/js2engine.h index eeb0efb8d93..fd13a2f5bb4 100644 --- a/js2/src/js2engine.h +++ b/js2/src/js2engine.h @@ -111,7 +111,6 @@ enum JS2Op { eBracketWriteRef, eBracketDelete, - eStop, eReturn, eReturnVoid, ePushFrame, // @@ -280,7 +279,7 @@ public: }; std::stack mTryStack; - std::stack mSubStack; + std::stack finallyStack; void pushHandler(uint8 *pc); void popHandler(); diff --git a/js2/src/js2op_flowcontrol.cpp b/js2/src/js2op_flowcontrol.cpp index 856ab93dbcd..c4158c035c9 100644 --- a/js2/src/js2op_flowcontrol.cpp +++ b/js2/src/js2op_flowcontrol.cpp @@ -143,18 +143,18 @@ case eCallFinally: { + int32 finallyOffset = BytecodeContainer::getOffset(pc); + uint8 *tgt = pc + finallyOffset; + pc += sizeof(int32); + finallyStack.push(pc); + pc = tgt; } break; case eReturnFinally: { - } - break; - - case eStop: - { - - return retval; + pc = finallyStack.top(); + finallyStack.pop(); } break; \ No newline at end of file