Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 02d77f1

Browse files
committed
Workaround bug in Boost
1 parent 213e0c8 commit 02d77f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libevm/VM.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,11 @@ void VM::interpretCases()
635635
if (m_SP[0] >= 256)
636636
m_SPP[0] = 0;
637637
else
638-
/// TODO: confirm shift >= 256 results in 0 on Boost
639-
m_SPP[0] = m_SP[1] << m_SP[0];
638+
{
639+
/// This workarounds a bug in Boost...
640+
u256 mask = (u256(1) << (256 - m_SP[0])) - 1;
641+
m_SPP[0] = (m_SP[1] & mask) << m_SP[0];
642+
}
640643
}
641644
NEXT
642645

0 commit comments

Comments
 (0)