[PATCH] D132331: [llvm] Mark CFGuard fn ptr symbol as DSO local and add tests for mingw

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 06:44:16 PDT 2022


mstorsjo added inline comments.


================
Comment at: llvm/lib/Transforms/CFGuard/CFGuard.cpp:250
   } else {
-    assert(GuardMechanism == CF_Dispatch && "Invalid CFGuard mechanism");
-    GuardFnGlobal =
-        M.getOrInsertGlobal("__guard_dispatch_icall_fptr", GuardFnPtrType);
+    assert("Invalid CFGuard mechanism");
   }
----------------
alvinhochun wrote:
> beanz wrote:
> > shafik wrote:
> > > This generates an implicit conversion of string-literal to bool. Alternatively you can do `assert(false && "Invalid CFGuard mechanism");`
> > I pushed a fix in rG961690574439dbdbc968000eab2ce2289f77a2d6
> Sorry about the error and thanks for fixing it.
Thanks for fixing! I guess that instead of `assert(false && “message…”);` it could also have been `llvm_unreachable(“message”);`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132331



More information about the llvm-commits mailing list