Open iVoider opened 1 year ago
Smaller repro
{
mstore(40, memoryguard(0x120306708))
sstore(1, mload(40))
}
For the record: we may want to produce better error messages for these cases, but those are all invalid uses of memoryguard
: The argument to memoryguard
defines the currently assumed start of "general purpose memory", so it will always be a low value - and a value beyond 2^32 for it makes no sense.
But yeah, this should be caught in Yul analysis rather than hit an assertion in Yul codegen.
Simplest repo is probably { sstore(0, memoryguard(0x100000000)) }
, the sstore
only being there to prevent the optimizer from eliminating the memoryguard altogether (otherwise pop(memoryguard(0x100000000))
should even be enough).
Description
The .yul snippet below
produces:
when compiled with
solc --strict-assembly --optimize test.yul
Environment
Steps to Reproduce
Description is self-sufficient