jasmin
jasmin copied to clipboard
Bad location for a warning
trafficstars
In the following code
fn f () -> reg u64 {
reg u64 r;
r = 0;
return r;
}
export fn main (reg u64 x) -> reg u64 {
reg u64 r;
f ();
r = x;
return r;
}
we get the warning warning: at line -1, introduce 1 _ lvalues (instead of line 9). This seems to be due to the absence of assignment. Indeed, in this other example
fn f () -> reg u64, reg u64 {
reg u64 r;
r = 0;
return r, r;
}
export fn main (reg u64 x) -> reg u64 {
reg u64 r;
r = f ();
return r;
}
we correctly get a warning mentioning line 9.