New Issue: core dump when passing a slice to a generic inout formal

17241, "mppf", "core dump when passing a slice to a generic inout formal", "2021-02-23T21:03:29Z"

The compiler is creating code that seg-faults at runtime when passing a slice to a generic inout formal.

Steps to Reproduce

Source Code:

proc f(inout arg) {
  writeln("in f, arg= ", arg);
  arg = 1;
}
{
  var A:[1..10] int;
  ref slice = A[1..3];
  f(slice);
  writeln(slice);
  writeln(A);
}

In 1.22, the program runs cleanly under valgrind and prints:

in f, arg= 0 0 0
1 1 1
1 1 1 0 0 0 0 0 0 0

In 1.23, the program segfaults.

Associated Future Test(s):
test/functions/intents/inout/in-conversion-inout-slice-formal-generic.chpl #17231