Repository navigation
fix(llvm): keep the panics of div, mod and constant indexing - #825
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The external LLVM backend revision containing the implementation requires final human review.
0 open findings
What changed in this PR
Adds regression coverage for legacy solc panic semantics restored by the LLVM backend update.
Changes:
- Tests zero-divisor panics for discarded modulo and unchecked division.
- Tests cleaned fixed-bytes indices.
- Tests constant out-of-bounds array access across storage, memory, and calldata.
| File | Description |
|---|---|
tests/solidity/simple/operator/casting/fixed_bytes_index_not_cleaned.sol |
Covers fixed-bytes index cleanup. |
tests/solidity/simple/operator/arithmetic/unused_division_by_zero.sol |
Covers retained zero-divisor panics. |
tests/solidity/simple/array/fixed_constant_index_out_of_bounds.sol |
Covers fixed-array bounds panics. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage Summary
|
nebasuke
added a commit
that referenced
this pull request
Oct 21, 2026
slang fails `test_RevertIf_ModError` because an unused `100 % a` loses its division-by-zero panic once optimized, which makes the Foundry step fail on a candidate-over-reference mismatch. #825 restores the panic; until then forge skips the test for both compilers, so the rest of the job can go green.
abinavpp
approved these changes
Nov 5, 2026
hedgar2017
force-pushed
the
fix-op-lowering-checks
branch
from
November 5, 2026 14:17
7c2327c to
f66d1dd
Compare
Compile-time benchmark (
|
| binary | median | mean ± σ | min … max | vs baseline |
|---|---|---|---|---|
| pr | 0.263 s | 0.263 s ± 0.006 s | 0.255 s … 0.274 s | 1.005× |
| main | 0.262 s | 0.261 s ± 0.004 s | 0.253 s … 0.265 s | 1.000× |
| prerelease | 0.501 s | 0.501 s ± 0.006 s | 0.491 s … 0.511 s | 1.916× |
openzeppelin-contracts-0.34--solx-legacy-dwarf
| binary | median | mean ± σ | min … max | vs baseline |
|---|---|---|---|---|
| pr | 1.970 s | 1.968 s ± 0.005 s | 1.960 s … 1.975 s | 1.001× |
| main | 1.967 s | 1.967 s ± 0.003 s | 1.963 s … 1.974 s | 1.000× |
| prerelease | 3.201 s | 3.200 s ± 0.013 s | 3.175 s … 3.221 s | 1.627× |
uniswap-v4-core-solx--solx-legacy-dwarf
| binary | median | mean ± σ | min … max | vs baseline |
|---|---|---|---|---|
| pr | 0.804 s | 0.811 s ± 0.014 s | 0.798 s … 0.841 s | 0.994× |
| main | 0.809 s | 0.812 s ± 0.014 s | 0.792 s … 0.842 s | 1.000× |
| prerelease | 2.086 s | 2.101 s ± 0.027 s | 2.074 s … 2.140 s | 2.577× |
hedgar2017
force-pushed
the
fix-op-lowering-checks
branch
from
November 5, 2026 19:21
f66d1dd to
f3c4e6b
Compare
hedgar2017
force-pushed
the
fix-op-lowering-checks
branch
from
November 5, 2026 20:17
f3c4e6b to
cc633ec
Compare
hedgar2017
enabled auto-merge
November 5, 2026 20:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps solx-llvm to NomicFoundation/solx-llvm#192, which restores three checks legacy solc performs:
a % bor uncheckeda / bpanics 0x12 on a zero divisorb[uint8(i)]on fixed bytes checks the cleaned index