From fda066eff4271bafa626d0fa425ed34519d1fcaa Mon Sep 17 00:00:00 2001 From: Arie Gurfinkel Date: Sat, 29 Oct 2022 13:02:26 -0400 Subject: [PATCH] fix: refine assertion --- lib/seadsa/DsaLocal.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/seadsa/DsaLocal.cc b/lib/seadsa/DsaLocal.cc index 5b25ad78..ac861b65 100644 --- a/lib/seadsa/DsaLocal.cc +++ b/lib/seadsa/DsaLocal.cc @@ -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)) { @@ -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");