From 853d5f2ee054948fb1f5b8e1cbe616f635a1cb85 Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Wed, 31 Dec 2003 02:53:02 +0000 Subject: [PATCH] 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 --- mozilla/js/src/jsscript.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mozilla/js/src/jsscript.h b/mozilla/js/src/jsscript.h index 97896a10619..ffcc40de7ba 100644 --- a/mozilla/js/src/jsscript.h +++ b/mozilla/js/src/jsscript.h @@ -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