mirror of
https://github.com/paradigmxyz/solidity-lean.git
synced 2026-11-15 19:56:39 +00:00
A custom-error revert argument is a value-use boundary: the argument CONTENTS are ABI-encoded into the revert data (like emit/abi.encode*/ keccak256). A bare state bytes/string/dynamic-array lowers to Expr.storage key, whose eval is the HEADER word (.length convention), so the error encoder's asBytes?/abiEncodeValues? returns none -> RevertData.typeMismatch = Panic(0). revert Bad(storageString) with error Bad(string) therefore diverged from solc+EVM (which materializes the storage string and reverts with the custom error carrying its contents). Fix: both custom-error revert lowering arms (bare-ident and member-qualified Stmt.revert name coreArgs) now wrap their arg cores with materializeStorageValueUseCores, mirroring the emit-event fix (#7); every other core shape passes through untouched. Regression: SolidCore/Witness/RevertCustomErrorStorageString.lean. Co-authored-by: Lean Semantics Review Agent <agent@solidcore.local> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
141 lines
5.2 KiB
141 lines
5.2 KiB