Bug 1283064 - restore correct value to |c.currentPrecedence| if PrintExpr fails. r?jorendorff draft
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Wed, 29 Jun 2016 14:23:43 +0300
changeset 382242 78d86b1f6c99a2fd808a3e6af8221b279ef1208b
parent 381966 e45890951ce77c3df05575bd54072b9f300d77b0
child 524145 b1e7c4bea21651631d001e4eaed1378ee6b5fc6d
push id21669
push userbmo:bpostelnicu@mozilla.com
push dateWed, 29 Jun 2016 11:25:37 +0000
reviewersjorendorff
bugs1283064
milestone50.0a1
Bug 1283064 - restore correct value to |c.currentPrecedence| if PrintExpr fails. r?jorendorff MozReview-Commit-ID: DGGyHIkXdt7
js/src/asmjs/WasmBinaryToExperimentalText.cpp
--- a/js/src/asmjs/WasmBinaryToExperimentalText.cpp
+++ b/js/src/asmjs/WasmBinaryToExperimentalText.cpp
@@ -366,18 +366,20 @@ PrintCallIndirect(WasmPrintContext& c, A
         return false;
 
     if (!c.buffer.append(" ["))
         return false;
 
     PrintOperatorPrecedence lastPrecedence = c.currentPrecedence;
     c.currentPrecedence = ExpressionPrecedence;
 
-    if (!PrintExpr(c, *call.index()))
+    if (!PrintExpr(c, *call.index())) {
+        c.currentPrecedence = lastPrecedence;
         return false;
+    }
 
     c.currentPrecedence = lastPrecedence;
 
     if (!c.buffer.append("] "))
         return false;
     if (!PrintCallArgs(c, call.args()))
         return false;
     return true;