This is an archive of the discontinued LLVM Phabricator instance.

[flang][NFC] Fix invalid op result access
ClosedPublic

Authored by clementval on Apr 10 2023, 12:03 PM.

Details

Summary

Fix invalid op result access. This will trigger
assertion introduced in D147883.

Diff Detail

Event Timeline

clementval created this revision.Apr 10 2023, 12:03 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 10 2023, 12:03 PM
clementval requested review of this revision.Apr 10 2023, 12:03 PM
frgossen accepted this revision.Apr 10 2023, 12:17 PM
This revision is now accepted and ready to land.Apr 10 2023, 12:17 PM
This revision was automatically updated to reflect the committed changes.

I had a few questions. But if none of them raise a red flag, all builds and tests correctly and looks good.

flang/lib/Lower/ConvertCall.cpp
223–224

This is the only place where sp gets an explicit value. Is this what you want?

407–416

Similarly, callResult only gets an explicit value if callNumResults is zero. Is this correct?

flang/lib/Lower/ConvertExpr.cpp
4279–4282

Similarly, outerRes doesn't always get an explicit value.

clementval added inline comments.Apr 10 2023, 1:07 PM
flang/lib/Lower/ConvertCall.cpp
223–224

Yes we want to get a value if there is actually a value. Otherwise it's just a null value.

407–416

When there is a value callNumResults != 0 we initialize callResult otherwise it is just a null mlir::Value