Skip to content

Commit

Permalink
chore[docs]: add evaluation order warning for builtins (#4158)
Browse files Browse the repository at this point in the history
some builtins have undefined order of evaluation of arguments; make a
note in the docs
  • Loading branch information
charles-cooper authored Jun 18, 2024
1 parent a72488c commit d92cd34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/built-in-functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1090,3 +1090,6 @@ Utilities
.. note::

Issuing of the static call is *NOT* mode-dependent (that is, it is not removed from production code), although the compiler will issue a warning whenever ``print`` is used.

.. warning::
In Vyper, as of v0.4.0, the order of argument evaluation of builtins is not defined. That means that the compiler may choose to reorder evaluation of arguments. For example, ``extract32(x(), y())`` may yield unexpected results if ``x()`` and ``y()`` both touch the same data. For this reason, it is best to avoid calling functions with side-effects inside of builtins. For more information, see `GHSA-g2xh-c426-v8mf <https://github.com/vyperlang/vyper/security/advisories/GHSA-g2xh-c426-v8mf>`_ and `issue #4019 <https://github.com/vyperlang/vyper/issues/4019>`_.

0 comments on commit d92cd34

Please sign in to comment.