Branch: refs/heads/main
Revision: b453fd2
Author: DanilaFe
Link: dyno: avoid resolution failures during calls to external functions. by DanilaFe · Pull Request #20282 · chapel-lang/chapel · GitHub
Log Message:
Merge pull request #20282 from DanilaFe/fix-resolve-extern
dyno: avoid resolution failures during calls to external functions.
When a resolver is being set up for processing a function signature,
the space allocaed for the ResolutionResultByPostorderId
is only
nonzero if the function has a body. When considering a call to an
extern function (which doesn't have a body) the byPostorderId
mapping
is empty, and thus retrieving the resolved expression for any parameter
results in an assertion failure or an error otherwise (presumably).
Instead of using the body()
of the function as the "largest known
node" when computing a postorder ID, this PR changes the code to look at
the last child. This change is not needed for setupForParamLoop
, since
a loop will always have a body.
Reviewed by @benharsh - thanks!
Testing:
- paratest
Signed-off-by: Danila Fedorin daniel.fedorin@hpe.com
Modified Files:
M compiler/dyno/lib/resolution/resolution-types.cpp
Compare: https://github.com/chapel-lang/chapel/compare/0770ec721030...b453fd2f21be