This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Check pointers for live-ness when returning them
ClosedPublic

Authored by tbaeder on Jul 9 2023, 11:11 AM.

Details

Summary
We might be trying to return a pointer or reference to a local variable,
which doesn't work.

Diff Detail

Event Timeline

tbaeder created this revision.Jul 9 2023, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2023, 11:11 AM
tbaeder requested review of this revision.Jul 9 2023, 11:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2023, 11:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

LGTM. It may be worth submitting an issue for the current behavior which is wrong.
Do you want to add a quote to the standard? (https://eel.is/c++draft/expr.const#13.3)

cor3ntin accepted this revision.Jul 16 2023, 6:09 AM
This revision is now accepted and ready to land.Jul 16 2023, 6:09 AM
This revision was landed with ongoing or failed builds.Jul 26 2023, 12:52 AM
This revision was automatically updated to reflect the committed changes.