Yul constant substitution loses lexical scope
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 52/100
Direzione di ricerca
Start by reading MastEval.escapingAssignsYulBlock and substYulStmt, the scope handling paths named in the issue. Trace how nested Yul declarations, loop initializers, and later assembly blocks affect constant invalidation and substitution. Done means the examples preserve the outer assignment and substitute 7 in both positions while keeping the loop-local binding.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
A declaration in a nested Yul block hides an earlier write to an outer variable from the constant invalidation logic. A later read is then incorrectly replaced with the old constant.
contract C {
function main() returns (word) {
let x: word = 0;
let y: word = 0;
assembly {
if calldatasize() { x := 5 { let x := 9 } }
y := x
}
return y;
}
}
Actual: the emitted Hull contains y := 0. Expected: keep y := x,
so the result can be 5 when calldata is nonempty. The nested let x must not
hide the outer assignment.
Loop initializers and later assembly blocks can also retain references to an outer comptime binding that has already been erased:
contract C {
function main() returns (word) {
let seed: comptime<word> = 7;
let y: word = 0;
assembly {
for { let seed := seed } lt(seed, 9) { seed := add(seed, 1) } {
y := add(y, seed)
}
}
assembly { y := add(y, seed) }
return y;
}
}
Actual: the outer comptime seed is erased, but the loop initializer still
contains let seed := seed, and the later assembly block retains an unbound
seed. Expected: substitute 7 in both positions while preserving the
loop-local binding. MastEval.escapingAssignsYulBlock and substYulStmt appear
to be the relevant scope-handling paths.
- Lingua principale
- Haskell
- Stelle
- 115
- Fork
- 11
- Merge medio
- 20h 29m
- PR unite (30g)
- 2
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di argotorg/solcore
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
user feedback: Rename `lam` to `lambda` and give the unit type a nameForse già presa @rodrigogribeiro l’ha presa 50 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 57/100
Tutte le issue di argotorg/solcore
Issue simili
-
Allow QuickCheck 2.17Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 75/100
-
15-minutes 5-minutes algorithm any-language beginner-friendly c cpp csharp easy go good first issue hacktoberfest help wanted java javascript kotlin python rust swift typescript
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
Huerte/algo-solutions-python#260 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
IntersectMBO/cardano-ledger#6276 ·
I maintainer di solito rispondono entro 1 giorno