jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Bad location for a warning

Open eponier opened this issue 4 years ago • 0 comments
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.

eponier avatar May 06 '21 11:05 eponier