Author: [email protected]
Date: Wed Jul  8 12:43:22 2009
New Revision: 2399

Modified:
    branches/bleeding_edge/src/arm/codegen-arm.cc

Log:
Fix crash in arm conditional expression code generation.
Review URL: http://codereview.chromium.org/155234

Modified: branches/bleeding_edge/src/arm/codegen-arm.cc
==============================================================================
--- branches/bleeding_edge/src/arm/codegen-arm.cc       (original)
+++ branches/bleeding_edge/src/arm/codegen-arm.cc       Wed Jul  8 12:43:22 2009
@@ -2424,13 +2424,23 @@
    JumpTarget exit;
    LoadConditionAndSpill(node->condition(), NOT_INSIDE_TYPEOF,
                          &then, &else_, true);
-  Branch(false, &else_);
-  then.Bind();
-  LoadAndSpill(node->then_expression(), typeof_state());
-  exit.Jump();
-  else_.Bind();
-  LoadAndSpill(node->else_expression(), typeof_state());
-  exit.Bind();
+  if (frame_ != NULL) {
+    Branch(false, &else_);
+  }
+  if (frame_ != NULL || then.is_linked()) {
+    then.Bind();
+    LoadAndSpill(node->then_expression(), typeof_state());
+  }
+  if (frame_ != NULL) {
+    exit.Jump();
+  }
+  if (else_.is_linked()) {
+    else_.Bind();
+    LoadAndSpill(node->else_expression(), typeof_state());
+  }
+  if (exit.is_linked()) {
+    exit.Bind();
+  }
    ASSERT(frame_->height() == original_height + 1);
  }


--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to