Chapel: Control flow analysis for error handling (in exported procedures)

Created on 29 Jan 2019  路  5Comments  路  Source: chapel-lang/chapel

Summary of Problem

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.

Steps to Reproduce

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

Configuration Information

  • Output of chpl --version: 953d8c97d1
Compiler Bug

All 5 comments

@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.

12204 will fix it, thanks for the bug report

Was this page helpful?
0 / 5 - 0 ratings