[INFER] Handle GETLOCALPROP in use-before-def analysis, bug 621522. r=bhackett
authorJan de Mooij <jandemooij@gmail.com>
Thu, 30 Dec 2010 08:31:05 -0500
changeset 74694 7480c25abc7f1a1b3e991fd5efe720c14b5957ee
parent 74693 ef84d90968c93ae5bddd37258828db927d5ef40f
child 74695 fbeecf1d1f4c61bfedd19bcc8d99a139ecaccdc9
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersbhackett
bugs621522
milestone2.0b8pre
[INFER] Handle GETLOCALPROP in use-before-def analysis, bug 621522. r=bhackett
js/src/jit-test/tests/jaeger/bug621522.js
js/src/jsanalyze.cpp
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/jaeger/bug621522.js
@@ -0,0 +1,14 @@
+
+/* Don't crash. */
+function f() {
+    var x;
+    x.a;
+    x = {};
+}
+
+try {
+    f();
+    assertEq(0, 1);
+} catch(e) {
+
+}
--- a/js/src/jsanalyze.cpp
+++ b/js/src/jsanalyze.cpp
@@ -776,17 +776,18 @@ Script::analyze(JSContext *cx, JSScript 
                     setLocal(local, LOCAL_USE_BEFORE_DEF);
             }
             break;
 
           case JSOP_CALLLOCAL:
           case JSOP_INCLOCAL:
           case JSOP_DECLOCAL:
           case JSOP_LOCALINC:
-          case JSOP_LOCALDEC: {
+          case JSOP_LOCALDEC:
+          case JSOP_GETLOCALPROP: {
             uint32 local = GET_SLOTNO(pc);
             if (local < nfixed && !localDefined(local, offset))
                 setLocal(local, LOCAL_USE_BEFORE_DEF);
             break;
           }
 
           case JSOP_SETLOCAL:
           case JSOP_FORLOCAL: {