Skip to content

Commit 3872849

Browse files
author
Mohammad Rezaei
committed
check for old evm versions
1 parent 088eaec commit 3872849

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libevmasm/ConstantOptimiser.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value)
259259
unsigned highOnes = 0;
260260
for (; ((_value >> lowZeros) & 1) == 0 && lowZeros < 256; lowZeros++) {}
261261
for (; ((_value >> (lowZeros + highOnes)) & 1) == 1 && highOnes < 256; highOnes++) {}
262-
if (highOnes > 32 && ((_value >> (lowZeros + highOnes)) == 0) &&
262+
if (m_params.evmVersion.hasBitwiseShifting() && highOnes > 32 &&
263+
((_value >> (lowZeros + highOnes)) == 0) &&
263264
((lowZeros + highOnes < 256) || lowZeros > 16))
264265
{
265266
// this is a big enough mask to use zero negation

0 commit comments

Comments
 (0)