[PATCH] D129448: [CodeGen][Asan] Emit lifetime intrinsic for bypassed label

luxufan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 10:10:13 PDT 2022


StephenFan added inline comments.


================
Comment at: clang/test/CodeGen/lifetime2.c:42
+    // O2: @llvm.lifetime.start.p0i8(i64 1
     bar(&x, 1);
+    // O2: @llvm.lifetime.end.p0i8(i64 1
----------------
vitalybuka wrote:
> It assume this will break Msan Transforms/Instrumentation/MemorySanitizer.cpp:1298 as it assume variable is not initialized on start
> 
> ```
> void goto_bypass(void) {
>   {
>     char x;
>   l1:
>     bar(&x, 1);
>    if (x)
>      goto l1
>   }
>   goto l1;
> }
> ```
Yes. I still need some time to see how to deal with it.


================
Comment at: clang/test/CodeGen/lifetime2.c:78
     break;
   case 2:
     bar(&x, 1);
----------------
vitalybuka wrote:
> vitalybuka wrote:
> > Please check for lifetime markers, I assume case 2 will have a new one
> > Please check for lifetime markers, I assume case 2 will have a new one
> Please check for *all* lifetime markers
> 
> you can add use "FileCheck --implicit-check-not llvm.lifetime" so it will fail if something has no corresponding match
> 
I have checked for all lifetime markers in `Diff 444701`. What's the point of adding `--implicit-check-not llvm.lifetime`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129448/new/

https://reviews.llvm.org/D129448



More information about the cfe-commits mailing list