Skip to content

Instantly share code, notes, and snippets.

@caitp
Created October 20, 2015 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caitp/589dcc90e80ddc37d3ef to your computer and use it in GitHub Desktop.
Save caitp/589dcc90e80ddc37d3ef to your computer and use it in GitHub Desktop.
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc
index eb9261d..9bc01a7 100644
--- a/src/crankshaft/hydrogen.cc
+++ b/src/crankshaft/hydrogen.cc
@@ -339,8 +339,8 @@ void HBasicBlock::RegisterPredecessor(HBasicBlock* pred) {
DCHECK(IsLoopHeader() || first_ == NULL);
HEnvironment* incoming_env = pred->last_environment();
if (IsLoopHeader()) {
- DCHECK_EQ(phis()->length(), incoming_env->length());
- for (int i = 0; i < phis_.length(); ++i) {
+ //DCHECK_EQ(phis()->length(), incoming_env->length());
+ for (int i = 0; i < std::min(phis_.length(), incoming_env->length()); ++i) {
phis_[i]->AddInput(incoming_env->values()->at(i));
}
} else {
@@ -13176,9 +13176,9 @@ void HEnvironment::Initialize(const HEnvironment* other) {
void HEnvironment::AddIncomingEdge(HBasicBlock* block, HEnvironment* other) {
DCHECK(!block->IsLoopHeader());
- DCHECK(values_.length() == other->values_.length());
+ //DCHECK(values_.length() >= other->values_.length());
- int length = values_.length();
+ int length = std::min(values_.length(), other->values_.length());
for (int i = 0; i < length; ++i) {
HValue* value = values_[i];
if (value != NULL && value->IsPhi() && value->block() == block) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment