evmone icon indicating copy to clipboard operation
evmone copied to clipboard

Do not init stack space to zero

Open chfast opened this issue 3 years ago • 1 comments

This proposes not to init stack space to zero. In theory, EVM should never read a stack item which has not been initialized previously with push or any other instruction. In practice, this change breaks at least Advanced. Problems are reported by valgrind and ASan e.g. in "dup_stack_overflow" test.

chfast avatar Jan 27 '22 11:01 chfast

Codecov Report

Merging #426 (34eb6cb) into master (74377f6) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #426   +/-   ##
=======================================
  Coverage   99.62%   99.62%           
=======================================
  Files          31       31           
  Lines        4017     4020    +3     
=======================================
+ Hits         4002     4005    +3     
  Misses         15       15           
Flag Coverage Δ
consensus 86.51% <100.00%> (ø)
unittests 99.67% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/evmone/execution_state.hpp 94.82% <100.00%> (+0.28%) :arrow_up:
test/unittests/execution_state_test.cpp 100.00% <100.00%> (ø)

codecov[bot] avatar Jan 27 '22 21:01 codecov[bot]