The program below exits before returning a value in a catch block. This program compiled and ran successfully in an earlier version of 1.19 (3e43323f10). As of master now (953d8c97d1), it generates a control flow error shown below. The variation without the export compiles and runs for both versions of Chapel.
Source Code:
export proc g(x: int): int {
try {
return 1;
} catch e {
exit(1);
}
}
export-g.chpl:1: In function 'g':
export-g.chpl:1: error: control reaches end of function that returns a value
chpl --version: 953d8c97d1@ben-albrecht: Have you git bisected which PR changed this?
@mppf: Could this be related to your owned error handling changes?
Have you git bisected which PR changed this?
Not thoroughly (yet). I only checked a handful of suspicious commits, including some of Michael's recent error handling changes, but no leads yet.
export isn't fundamental to the problem - this version also fails
proc g(x: int): int {
try {
return 1;
} catch e {
exit(1);
}
}
writeln(g(1));
@bradcray
@mppf: Could this be related to your owned error handling changes?
yes, in #12090 I needed to make a change to isDefinedAllPaths, and this seems to be failing in nearby code.