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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 19 09:33:37 PST 2019


nickdesaulniers added a comment.

> Use -Wuninitialized.

D'oh!



================
Comment at: clang/lib/Analysis/UninitializedValues.cpp:856
   if (!as->isAsmGoto())
     return;
 
----------------
nickdesaulniers wrote:
> Should we mark the vals `MayUninitialized` here, rather than below? Then I think we can remove the `isAsmGoto` check you added in `getUninitUse`?
Bumping comment.


================
Comment at: clang/test/Analysis/uninit-asm-goto.cpp:57
+  return y;
+indirect:
+  return -2;
----------------
I think if you left out `indirect`, it would be clearer what this test is testing.


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