Add stack limit evader.

This commit is contained in:
Daniel Kirchner
2020-09-17 22:13:27 +02:00
parent b571fd05b0
commit f4b42d1c72
54 changed files with 2323 additions and 66 deletions
+14
View File
@@ -952,6 +952,20 @@ option.
See :ref:`Using the Commandline Compiler <commandline-compiler>` for details about the Solidity linker.
memoryguard
^^^^^^^^^^^
This function is available in the EVM dialect with objects. The caller of
``let ptr := memoryguard(size)`` promises that they only use memory in either
the range ``[0, size)`` or the unbounded range above ``ptr``. The Yul optimizer
promises to only use the memory range ``[size, ptr)`` for its purposes.
If the optimizer does not need to reserve any memory, it holds that ``ptr := size``.
``memoryguard`` can be called multiple times, but needs to have the same literal as argument
within one Yul subobject. If at least one ``memoryguard`` call is found in a subobject,
the Yul optimiser will try to perform experimental steps like the stack limit evader,
which attempts to move stack variables that would otherwise be unreachable
to memory.
.. _yul-object: