Skip to content

[mlir][Sol] Emit debug revert strings in the dispatcher guard reverts - #128

Merged
abinavpp merged 1 commit into
mainfrom
app-dispatcher-revert-strings
Jul 28, 2026
Merged

[mlir][Sol] Emit debug revert strings in the dispatcher guard reverts#128
abinavpp merged 1 commit into
mainfrom
app-dispatcher-revert-strings

Conversation

@abinavpp

@abinavpp abinavpp commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds compiler-generated debug revert strings for dispatcher guard reverts during Sol-to-Yul lowering, improving debuggability when calls revert due to non-payable value transfers or missing fallback/receive handling.

Changes:

  • Emit a debug revert string when Ether is sent to a non-payable function (instead of a bare revert).
  • Emit a debug revert string when no fallback exists (distinguishing whether receive() exists).
  • Add an unconditional genDebugRevertWithMsg(std::string, Location) overload to the EVM builder.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
mlir/lib/Conversion/SolToYul/SolToYul.cpp Switch dispatcher guard reverts to use debug revert messages for clearer failure reasons.
mlir/lib/Conversion/SolToYul/EVMUtil.cpp Add unconditional debug-revert-with-message helper that falls back to plain revert when disabled.
mlir/include/mlir/Conversion/SolToYul/EVMUtil.h Declare the new unconditional genDebugRevertWithMsg overload in the builder API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread mlir/lib/Conversion/SolToYul/SolToYul.cpp
@abinavpp
abinavpp force-pushed the app-dispatcher-revert-strings branch from 9774d16 to d771ff5 Compare July 27, 2026 18:45
@abinavpp
abinavpp force-pushed the app-lowering-sem-fixes branch 2 times, most recently from 5d9e222 to 98884a4 Compare July 27, 2026 19:03
@abinavpp
abinavpp force-pushed the app-dispatcher-revert-strings branch from d771ff5 to 4d32b12 Compare July 27, 2026 19:03

@PavelKopyl PavelKopyl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@abinavpp
abinavpp force-pushed the app-lowering-sem-fixes branch from 98884a4 to 384e1d7 Compare July 28, 2026 12:45
@abinavpp
abinavpp force-pushed the app-dispatcher-revert-strings branch from 4d32b12 to 1f62640 Compare July 28, 2026 12:45
@abinavpp
abinavpp changed the base branch from app-lowering-sem-fixes to main July 28, 2026 12:46
@abinavpp
abinavpp force-pushed the app-dispatcher-revert-strings branch 5 times, most recently from f7c69fc to 5b8b157 Compare July 28, 2026 12:54
@abinavpp
abinavpp force-pushed the app-dispatcher-revert-strings branch from 5b8b157 to 8f57970 Compare July 28, 2026 12:55
@abinavpp
abinavpp merged commit 2879c4e into main Jul 28, 2026
2 checks passed
@abinavpp
abinavpp deleted the app-dispatcher-revert-strings branch July 28, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants