aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libevmasm/Assembly.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp
index 37c4fb22..5fab24e1 100644
--- a/libevmasm/Assembly.cpp
+++ b/libevmasm/Assembly.cpp
@@ -407,8 +407,11 @@ map<u256, u256> Assembly::optimiseInternal(
if (_settings.runPeephole)
{
PeepholeOptimiser peepOpt(m_items);
- while (peepOpt.optimise() && count < 0xffffff)
+ while (peepOpt.optimise())
+ {
count++;
+ assertThrow(count < 64000, OptimizerException, "Peephole optimizer seems to be stuck.");
+ }
}
// This only modifies PushTags, we have to run again to actually remove code.