V4: Fix use of uninitialized field.
authorErik Verbruggen <erik.verbruggen@digia.com>
Fri, 5 Jun 2015 13:20:23 +0000 (15:20 +0200)
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>
Mon, 8 Jun 2015 08:22:11 +0000 (08:22 +0000)
Valgrind pointed out that Transition::id was used in a conditional jump
or move. Fixes regressions of the following tests on OSX:

  ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-2-1 in non-strict mode
  ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-2-2 in non-strict mode
  ch15/15.2/15.2.3/15.2.3.12/15.2.3.12-3-28 in non-strict mode

Change-Id: Ia959ff6f9fdac8d4cb37f54f670fdff4c8ba9a67
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
src/qml/jsruntime/qv4internalclass.cpp

index 49b284b97926650b12f233198553adec8edac919..a90e8e36895c128f4550ca38c68b80b73726e40d 100644 (file)
@@ -199,10 +199,7 @@ InternalClass *InternalClass::nonExtensible()
     if (!extensible)
         return this;
 
-    Transition temp;
-    temp.lookup = 0;
-    temp.flags = Transition::NotExtensible;
-
+    Transition temp = { Q_NULLPTR, Q_NULLPTR, Transition::NotExtensible};
     Transition &t = lookupOrInsertTransition(temp);
     if (t.lookup)
         return t.lookup;