Inlining discards side effects in unused arguments
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by locating the inlining pass and its tests for unused function arguments; the issue does not name specific files. Trace how arguments are handled when a parameter is unused, then add a regression test based on the example that checks the storage write is emitted exactly once before the return. Done means inlining preserves the argument's side effect while returning 7.
Written by the indexing model from the issue text.
Description
Inlining a function that ignores one parameter discards side effects in the corresponding argument. In this example, the storage write disappears from the generated code.
function writeSlot() returns (word) {
assembly { sstore(0, 1) }
return 0;
}
function second(a: word, b: word) returns (word) { return b; }
contract C {
function main() returns (word) {
return second(writeSlot(), 7);
}
}
Actual: the emitted main contains only return 7; sstore(0, 1) has disappeared.
Expected: evaluate writeSlot() exactly once before returning 7, even though second does not use its first parameter. Inlining must preserve argument effects.
- Dominant language
- Haskell
- Stars
- 115
- Forks
- 11
- Avg merge
- 20h 29m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from argotorg/solcore
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
user feedback: Rename `lam` to `lambda` and give the unit type a namePossibly taken @rodrigogribeiro claimed this 50 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
All issues in argotorg/solcore
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
IntersectMBO/cardano-ledger#6276 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
OpenZeppelin/canton-contracts#92 ·
Maintainers usually reply within 1 day