Fix SCRIPT_FIND_CATCH_START to cope with exceptions thrown from prolog bytecodes (206199, r=shaver, a=asa).

git-svn-id: svn://10.0.0.236/trunk@150794 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brendan%mozilla.org
2003-12-31 02:53:02 +00:00
parent 007755d8cd
commit 853d5f2ee0

View File

@@ -85,11 +85,13 @@ struct JSScript {
JSTryNote *tn_ = (script)->trynotes; \
jsbytecode *catchpc_ = NULL; \
if (tn_) { \
ptrdiff_t offset_ = PTRDIFF(pc, (script)->main, jsbytecode); \
while (JS_UPTRDIFF(offset_, tn_->start) >= (jsuword)tn_->length) \
++tn_; \
if (tn_->catchStart) \
catchpc_ = (script)->main + tn_->catchStart; \
ptrdiff_t off_ = PTRDIFF(pc, (script)->main, jsbytecode); \
if (off_ >= 0) { \
while ((jsuword)(off_ - tn_->start) >= (jsuword)tn_->length) \
++tn_; \
if (tn_->catchStart) \
catchpc_ = (script)->main + tn_->catchStart; \
} \
} \
catchpc = catchpc_; \
JS_END_MACRO