[PATCH] D74094: Reapply: [IRGen] Emit lifetime intrinsics around temporary aggregate argument allocas
Vitaly Buka via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 1 10:56:48 PDT 2023
vitalybuka added a comment.
In D74094#4633785 <https://reviews.llvm.org/D74094#4633785>, @alexfh wrote:
> This commit caused invalid AddressSanitizer: stack-use-after-scope errors in our internal setup. Trying to create a standalone repro, but so far we think that the patch is incorrect. @vitalybuka says "The patch seems wrong, callee can return a reference to temp, so lifetime should be extended to full expression."
I will lazily quote https://en.cppreference.com/w/cpp/language/lifetime, we can lookup the standard, all ask experts, if this is wrong:
All temporary objects are destroyed as the last step in evaluating the full-expression that (lexically) contains the point where they were created, and if multiple temporary objects were created, they are destroyed in the order opposite to the order of creation. This is true even if that evaluation ends in throwing an exception.
And full-expression here is:
const Tensor t3 = round(a.log().exp());
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74094/new/
https://reviews.llvm.org/D74094
More information about the cfe-commits
mailing list