Skip to content

Latest commit

 

History

History
18 lines (17 loc) · 935 Bytes

Double shift size overflow.md

File metadata and controls

18 lines (17 loc) · 935 Bytes

Double bitwise shifts by large constants whose sum overflows 256 bits can result in unexpected values. Nested logical shift operations whose total shift size is 2**256 or more are incorrectly optimized. This only applies to shifts by numbers of bits that are compile-time constant expressions. This happens when the optimizer is used and evmVersion >= Constantinople. This is due to a compiler bug introduced in v0.5.5 and fixed in v0.5.6. (see here)


Slide Screenshot

085.jpg


Slide Text

  • Double Shift Size Overflow
  • Optimizer Double Bitwise Shifts
  • Shift > 2**256 -> Overflow
  • Compiler Bug -> Fixed
  • solc 0.5.5 -> 0.5.6

References


Tags