Skip to content

Commit

Permalink
fix argsize of ext call
Browse files Browse the repository at this point in the history
  • Loading branch information
bjjwwang committed Jan 16, 2024
1 parent 9629983 commit ba9951d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions svf-llvm/include/SVF-LLVM/SVFIRBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,21 @@ class SVFIRBuilder: public llvm::InstVisitor<SVFIRBuilder>
if (calledFunc) {
const std::string& functionName = calledFunc->getName().str();
if (functionName == "malloc") {
if (cs->getNumOperands() > 0) {
if (cs->arg_size() > 0) {
const llvm::Value* val = cs->getArgOperand(0);
SVFValue* svfval = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(val);
edge->addArrSize(svfval);
}
}
// Check if the function called is 'calloc' and process its arguments.
else if (functionName == "calloc") {
if (cs->getNumOperands() > 1) {
if (cs->arg_size() > 1) {
edge->addArrSize(LLVMModuleSet::getLLVMModuleSet()->getSVFValue(cs->getArgOperand(0)));
edge->addArrSize(LLVMModuleSet::getLLVMModuleSet()->getSVFValue(cs->getArgOperand(1)));
}
}
else {
if (cs->getNumOperands() > 0) {
if (cs->arg_size() > 0) {
const llvm::Value* val = cs->getArgOperand(0);
SVFValue* svfval = LLVMModuleSet::getLLVMModuleSet()->getSVFValue(val);
edge->addArrSize(svfval);
Expand Down

0 comments on commit ba9951d

Please sign in to comment.