Skip to content

Commit b988d27

Browse files
committed
[Clang][OpenMP] Add Assertion to Prevent Null Pointer Dereference in OpenMP IR Builder
1 parent 0f04043 commit b988d27

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6966,6 +6966,10 @@ static Function *emitTargetTaskProxyFunction(OpenMPIRBuilder &OMPBuilder,
69666966
auto *ArgStructType =
69676967
dyn_cast<StructType>(ArgStructAlloca->getAllocatedType());
69686968

6969+
assert(ArgStructType &&
6970+
"Unable to find the struct type corresponding to the alloca "
6971+
"instruction");
6972+
69696973
AllocaInst *NewArgStructAlloca =
69706974
Builder.CreateAlloca(ArgStructType, nullptr, "structArg");
69716975
Value *TaskT = ProxyFn->getArg(1);

0 commit comments

Comments
 (0)