Skip to content

Commit e3773d6

Browse files
committed
[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-svn: 256580
1 parent 7a7abc9 commit e3773d6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ InsertSafepointPoll(Instruction *InsertBefore,
762762
// path call - where we need to insert a safepoint (parsepoint).
763763

764764
auto *F = M->getFunction(GCSafepointPollName);
765+
assert(F && "gc.safepoint_poll function is missing");
765766
assert(F->getType()->getElementType() ==
766767
FunctionType::get(Type::getVoidTy(M->getContext()), false) &&
767768
"gc.safepoint_poll declared with wrong type");

0 commit comments

Comments
 (0)