Skip to content

Commit

Permalink
fix: refine assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
agurfinkel committed Oct 29, 2022
1 parent 3579b74 commit fda066e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/seadsa/DsaLocal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ void IntraBlockBuilder::visitCallBase(CallBase &I) {
visitAllocationFnCall(I);
return;
}

// direct function call
if (auto *callee = getCalledFunction(I)) {
if (m_allocInfo.isAllocWrapper(*callee)) {
Expand All @@ -1460,6 +1460,14 @@ void IntraBlockBuilder::visitCallBase(CallBase &I) {
return;
}

// a function that does not return a pointer is a noop
if (!I.getType()->isPointerTy()) return;


// -- something unexpected. Keep an assert so that we know that something
// -- unexpected happened.

// calls that have no pointer arg
// nothing is expected here
assert(false && "Unexpected CallSite");
llvm_unreachable("Unexpected");
Expand Down

0 comments on commit fda066e

Please sign in to comment.