diff --git a/lib/Clam/CfgBuilder.cc b/lib/Clam/CfgBuilder.cc index 8df51c8e..ec055166 100644 --- a/lib/Clam/CfgBuilder.cc +++ b/lib/Clam/CfgBuilder.cc @@ -3720,7 +3720,14 @@ CfgBuilderImpl::getCrabBasicBlock(const BasicBlock *src, llvm::Optional CfgBuilderImpl::getCrabVariable(const llvm::Value &v) { crab_lit_ref_t lit = m_lfac.getLit(v); - return (lit->isVar() ? llvm::Optional(lit->getVar()) : llvm::Optional()); + if (lit == nullptr || !lit->isVar()) { + // getLit only supports integers and pointers. For instance, if v is the lhs of this instruction: + // %x = call { i64, i1 } @llvm.umul.with.overflow.i64(...) + // then lit will be null. + return llvm::None; + } else { + return llvm::Optional(lit->getVar()); + } }