[llvm] r256580 - [PlaceSafepoints] Assert that the gc.safepoint_poll function is present in the module.
Manuel Jacob via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 29 13:57:56 PST 2015
Date: Tue Dec 29 15:57:55 2015
New Revision: 256580
[PlaceSafepoints] Assert that the gc.safepoint_poll function is present in the module.
If running the PlaceSafepoints pass on a module which doesn't have the
gc.safepoint_poll function without disabling entry and backedge safepoints,
previously the pass crashed with an obscure error because of a null pointer.
Now it fails the assert instead.
--- llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp Tue Dec 29 15:57:55 2015
@@ -762,6 +762,7 @@ InsertSafepointPoll(Instruction *InsertB
// path call - where we need to insert a safepoint (parsepoint).
auto *F = M->getFunction(GCSafepointPollName);
+ assert(F && "gc.safepoint_poll function is missing");
FunctionType::get(Type::getVoidTy(M->getContext()), false) &&
"gc.safepoint_poll declared with wrong type");
More information about the llvm-commits