This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Make CXXTemporaryObjectExprs leave a value behind
AbandonedPublic

Authored by tbaeder on Jun 23 2023, 11:14 AM.

Details

Summary
visitLocalInitializer() pops the pointer from the stack again, but we
might be called in a situation where the caller would actually like to
use the value.

Diff Detail

Event Timeline

tbaeder created this revision.Jun 23 2023, 11:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 11:14 AM
tbaeder requested review of this revision.Jun 23 2023, 11:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 11:14 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder updated this revision to Diff 534174.Jun 24 2023, 12:48 AM
shafik added inline comments.Jun 26 2023, 10:41 AM
clang/lib/AST/Interp/ByteCodeExprGen.cpp
1022

Could you just pass DiscardResult to visitLocalInitializer

tbaeder added inline comments.Jun 28 2023, 10:21 PM
clang/lib/AST/Interp/ByteCodeExprGen.cpp
1022

Nope, the visitInitializer function(s) don't handle DiscardResult at all right now; they just initialize an already existing value.

shafik accepted this revision.Jul 26 2023, 1:48 PM

LGTM

This revision is now accepted and ready to land.Jul 26 2023, 1:48 PM
tbaeder abandoned this revision.Sep 5 2023, 4:13 AM

This was pushed as part of the initializer rework.