[PATCH] D71314: Emit a warning if a variable is uninitialized in indirect ASM goto destination.

Bill Wendling via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 24 19:10:25 PST 2020


void marked an inline comment as done.
void added inline comments.


================
Comment at: clang/lib/Analysis/UninitializedValues.cpp:856
+        vals[VD] = MayUninitialized;
 }
 
----------------
nickdesaulniers wrote:
> Can you walk me through the logic of this function?
> 
> I would assume for changes to `asm goto`, the above early `return` would have been removed? Otherwise we seem to be changing the logic of the non-`asm goto` case?
Sure. If the variable hasn't been initialized by the time it gets to the asm goto, then we mark it as "potentially uninitialized" so that it's caught on the indirect branch. Uses on the default/fallthrough path should resolve to "initialized".

I'll add a comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71314





More information about the cfe-commits mailing list