Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed when using getLLVMValue() on Value got from IntraICFGNode->getInst() #1441

Open
S-Hang23 opened this issue Apr 20, 2024 · 1 comment

Comments

@S-Hang23
Copy link

Hello everyone, I'm new to SVF. I attempted to traverse on ICFG and transfer SVFValue to LLVMValue so that I could do some customed analysis.
However, after I get SVFInstruction from IntraICFGNode, and use LLVMModuleSet::getLLVMModuleSet()->getLLVMValue(), This assert failed and shut down the program.

assert(it!=SVFValue2LLVMValue.end() && "can't find corresponding llvm value!")

Some of my code is as follow:

IntraICFGNode* iNode = cast<IntraICFGNode>(icfgNode);
const SVFInstruction* svfInst = iNode->getInst();
if(svfInst == nullptr) continue;
const llvm::Value* llvmVal = LLVMModuleSet::getLLVMModuleSet()->getLLVMValue(svfInst);

I doubt that the svfInst I got from IntraICFGNode could not be found corresponding llvm value.
BUT, when I traverse the bitcode like:

for(auto f: *svfModule){
    for(auto bb: *f){
        for(auto i: *bb){
            const llvm::Value* llvmVal = LLVMModuleSet::getLLVMModuleSet()->getLLVMValue(i);
        }
    }
}

The program above worked well.
I wonder why both codes convert SVFInstruction into LLVMValue but only second one succeed. Is it not supposed that I use getLLVMValue on SVFInstruction got from IntraICFGNode->getInst()?

@yuleisui
Copy link
Collaborator

yuleisui commented Jun 1, 2024

Could you print out and call the toString() method of that SVFValue or SVFInstruction, so that we know where the issue is?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants