Skip to content

Commit 8fa65ce

Browse files
committedOct 13, 2017
- Fix a regression.
1 parent 513ac0f commit 8fa65ce

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed
 

‎porosity/porosity/Contract.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ Contract::addBasicBlock(
5555
BasicBlockInfo newEntry = { 0 };
5656
newEntry.offset = _offset;
5757
newEntry.size = _size;
58+
newEntry.nextDefault = NULL;
59+
newEntry.nextJUMPI = NULL;
5860

5961
auto newBlock = m_listbasicBlockInfo.insert(m_listbasicBlockInfo.begin(), pair<uint32_t, BasicBlockInfo>(_offset, newEntry));
6062

@@ -380,10 +382,8 @@ Contract::walkAndConnectNodes(
380382
while (true) {
381383
auto block = m_listbasicBlockInfo.find(next); // getBlockAt()
382384
if (block == m_listbasicBlockInfo.end()) break;
383-
384-
if (block->second.walkedNode) break;
385-
386385
next = block->second.dstDefault;
386+
if (block->second.walkedNode) continue;
387387

388388
// printf("hash = 0x%x, block = 0x%x, default = 0x%x, JUMPI = 0x%x\n", _hash, _block, block->second.dstDefault, block->second.dstJUMPI);
389389
if (block->second.dstJUMPI) {
@@ -398,10 +398,8 @@ Contract::walkAndConnectNodes(
398398
block->second.dstDefault = exitNode->second;
399399
}
400400

401-
if (!block->second.nextDefault) {
402-
block->second.nextDefault = getBlockAt(block->second.dstDefault);
403-
}
404-
break; // next
401+
block->second.nextDefault = getBlockAt(block->second.dstDefault);
402+
break; // next
405403
}
406404
}
407405
}

0 commit comments

Comments
 (0)
Please sign in to comment.