Reviewers: Jakob,

Description:
Fix VisitLogicalExpression for empty blocks on RHS.

[email protected]
BUG=chromium:242870
TEST=mjsunit/regress/regress-crbug-242870

Please review this at https://codereview.chromium.org/15744002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/hydrogen.cc
  A + test/mjsunit/regress/regress-crbug-242870.js


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index b53e9b514e78ab19fe140422a23c1fb303809fa1..097216ef830b9660042ee31ee2bb82a618ca5e23 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -10499,7 +10499,7 @@ void HOptimizedGraphBuilder::VisitLogicalExpression(BinaryOperation* expr) {
       if ((is_logical_and && left_constant->BooleanValue()) ||
           (!is_logical_and && !left_constant->BooleanValue())) {
         Drop(1);  // left_value.
-        CHECK_BAILOUT(VisitForValue(expr->right()));
+        CHECK_ALIVE(VisitForValue(expr->right()));
       }
       return ast_context()->ReturnValue(Pop());
     }
Index: test/mjsunit/regress/regress-crbug-242870.js
diff --git a/test/mjsunit/regress/regress-2671.js b/test/mjsunit/regress/regress-crbug-242870.js
similarity index 91%
copy from test/mjsunit/regress/regress-2671.js
copy to test/mjsunit/regress/regress-crbug-242870.js
index 8da1b8f07f69c487fe9913e485c60f3e257e0986..7183375ca811cedc81c870d34e694e98cf727f9b 100644
--- a/test/mjsunit/regress/regress-2671.js
+++ b/test/mjsunit/regress/regress-crbug-242870.js
@@ -27,19 +27,17 @@

 // Flags: --allow-natives-syntax

-var y;
+var non_const_true = true;
+
 function f() {
-  var a = [];
-  a[20] = 0;
-  y = 3;
-  var i = 7 * (y + -0);
-  a[i] = 1/y;
-  assertFalse(isNaN(a[i]));
+  return (non_const_true || true && g());
 }

-f();
-f();
-f();
-%OptimizeFunctionOnNextCall(f);
-f();
+function g() {
+  for (;;) {}
+}

+assertTrue(f());
+assertTrue(f());
+%OptimizeFunctionOnNextCall(f);
+assertTrue(f());


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to