You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yul: dump source/target stacks when findStackTooDeep aborts
Add an opt-in debug dump for the case described in
#16704: when `findStackTooDeep` propagates a
`YulAssertion` from `createStackLayout` (e.g. "Could not create stack
layout after 1000 iterations"), the source and target stacks at that
point are otherwise opaque to anyone debugging from a user-supplied
.sol reproducer.
When the environment variable `YUL_DEBUG_DUMP_SHUFFLE_FAILURE` is set
to a non-empty value, the source and target stacks (rendered via the
existing `stackToString(Stack, Dialect)` helper) are printed to stderr
in the StackShufflingTest `.stack` format (see
test/libyul/yulStackShuffling/*.stack), so the failing input can be
dropped into the test suite verbatim. Example:
// findStackTooDeep aborted (source.size=1, target.size=1237)
[ RET ]
[ RET RET[fun_double_27] RET[fun_double_27] ... ]
// ====
// maximumStackDepth: 16
Mechanically:
* `findStackTooDeep` gains a `Dialect const&` parameter (needed by
`stackToString` for resolving function names in `RET[...]` /
`TMP[...]` slots). All four call sites already have `m_evmDialect`
available and pass it through.
* The `::createStackLayout` invocation is wrapped in a `try` /
`catch (YulAssertion const&)` that does the conditional stderr
print and then `throw;`s -- so when the env var is unset, behavior
is byte-identical to before.
No Changelog entry: this is a developer-only debug aid and doesn't
change any user-visible behavior.
0 commit comments