Bug 619479 - Fix the mapping between PC offsets and source notes (r=dmandelin, a=blocker)
authorSteve Fink <sfink@mozilla.com>
Thu, 16 Dec 2010 15:35:30 -0800
changeset 60153 955e406e35b111176cfd8f6b351bfcf41dfe2d8c
parent 60152 5b7ecdabfe49e74a28e5d1d9c8418f05b77eef45
child 60154 32ff6481fba8ca1585f8f259904456e61b7b0085
push idunknown
push userunknown
push dateunknown
reviewersdmandelin, blocker
bugs619479
milestone2.0b9pre
Bug 619479 - Fix the mapping between PC offsets and source notes (r=dmandelin, a=blocker)
js/src/methodjit/Compiler.cpp
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -818,31 +818,31 @@ mjit::Compiler::finishThisUp(JITScript *
     return Compile_Okay;
 }
 
 class SrcNoteLineScanner {
     ptrdiff_t offset;
     jssrcnote *sn;
 
 public:
-    SrcNoteLineScanner(jssrcnote *sn) : offset(0), sn(sn) {}
+    SrcNoteLineScanner(jssrcnote *sn) : offset(SN_DELTA(sn)), sn(sn) {}
 
     bool firstOpInLine(ptrdiff_t relpc) {
         while ((offset < relpc) && !SN_IS_TERMINATOR(sn)) {
+            sn = SN_NEXT(sn);
             offset += SN_DELTA(sn);
-            sn = SN_NEXT(sn);
         }
 
         while ((offset == relpc) && !SN_IS_TERMINATOR(sn)) {
             JSSrcNoteType type = (JSSrcNoteType) SN_TYPE(sn);
             if (type == SRC_SETLINE || type == SRC_NEWLINE)
                 return true;
-                
+
+            sn = SN_NEXT(sn);
             offset += SN_DELTA(sn);
-            sn = SN_NEXT(sn);
         }
 
         return false;
     }
 };
 
 #ifdef DEBUG
 #define SPEW_OPCODE()                                                         \