Revision: 14882
Author:   [email protected]
Date:     Wed May 29 05:36:41 2013
Log:      Make sure IfBuilder::Return clears the current block.

This is a follow-up to an earlier bugfix. It doesn't yet trigger any
known bugs but is a safety precaution since IfBuilder usage increases.

[email protected]
BUG=chromium:243868

Review URL: https://codereview.chromium.org/15832005
http://code.google.com/p/v8/source/detail?r=14882

Modified:
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Wed May 29 03:47:55 2013 +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Wed May 29 05:36:41 2013
@@ -186,11 +186,12 @@
     }
   }

-  if (!current_block()->IsFinished()) {
+  if (current_block() != NULL) {
     HReturn* hreturn_instruction = new(zone) HReturn(return_value,
                                                      context_,
                                                      stack_pop_count);
     current_block()->Finish(hreturn_instruction);
+    set_current_block(NULL);
   }
   return true;
 }
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed May 29 03:47:55 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed May 29 05:36:41 2013
@@ -822,9 +822,10 @@

 void HGraphBuilder::IfBuilder::Return(HValue* value) {
   HBasicBlock* block = builder_->current_block();
-  block->Finish(new(zone()) HReturn(value,
- builder_->environment()->LookupContext(), - builder_->graph()->GetConstantMinus1()));
+  HValue* context = builder_->environment()->LookupContext();
+  HValue* parameter_count = builder_->graph()->GetConstantMinus1();
+  block->FinishExit(new(zone()) HReturn(value, context, parameter_count));
+  builder_->set_current_block(NULL);
   if (did_else_) {
     first_false_block_ = NULL;
   } else {

--
--
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