Bug 1500822 - Fix a try-note range check in the debugger r=jorendorff
authorTed Campbell <tcampbell@mozilla.com>
Mon, 22 Oct 2018 21:47:47 +0000
changeset 490840 147e4ace74cc3035a8f995b043529d46ab77ae17
parent 490839 38e27cc84adc0c40e60e13faac5bdd632591ab4f
child 490841 f3273aa382dca7f8149d9839603635d183dc2cf5
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersjorendorff
bugs1500822
milestone65.0a1
Bug 1500822 - Fix a try-note range check in the debugger r=jorendorff This should symptomless since the extra op should always be a JSOP_GOTO which will be skipped over anyways. Fix for our sanity. Differential Revision: https://phabricator.services.mozilla.com/D9422
js/src/vm/Debugger.cpp
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -7464,17 +7464,17 @@ class DebuggerScriptIsInCatchScopeMatche
     ReturnType match(HandleScript script) {
         if (!EnsureScriptOffsetIsValid(cx_, script, offset_)) {
             return false;
         }
 
         if (script->hasTrynotes()) {
             for (const JSTryNote& tn : script->trynotes()) {
                 if (tn.start <= offset_ &&
-                    offset_ <= tn.start + tn.length &&
+                    offset_ < tn.start + tn.length &&
                     tn.kind == JSTRY_CATCH)
                 {
                     isInCatch_ = true;
                     return true;
                 }
             }
         }
         isInCatch_ = false;