Closed DenialAdams closed 1 year ago
proc main() {
loop {
let x: u8 = 10;
use(x);
let y: u8 = 20;
use(y);
// y and x can coalesce
}
}
Also everything is dead after infinite loop
Also everything is dead after infinite loop
This is probably better resolved by a DCE pass
Recent change i made was unsound:
proc use(x: u8) {
println(uint_to_string(x as u64));
}
proc main() {
let i: u32 = 0;
let x: u8 = ___;
loop {
loop {
break;
x = 10;
}
use(x);
let y = 20;
use(y);
i = i + 1;
if i > 1 {
break;
}
}
}
Hard to find an unsoundness example that doesn't use uninitialized memory though...
Implemented in c2fc4b9c4eb36c094d17cc523f5029d334bfc1f2
Created https://github.com/DenialAdams/roland/issues/109 for soundness concerns
For example, variables are assumed to live as long as any enclosing loop