[LLVMdev] llvm segfault Instruction::getOpcode

Alexandru Ionut Diaconescu alexandruionutdiaconescu at gmail.com
Fri Dec 21 03:12:00 PST 2012


I get a segfault and I cannot find the reason. The main computation is done
in "
`struct patternDC : public FunctionPass`
" but I also have

    class ifChecker {
        virtual bool operEquiv(Instruction *I1, Instruction *I2);

I have in

    bool patternDC::runOnFunction(Function &F) {
      ifChecker* CC=new ifChecker();
       if ( CC->operEquiv(ifsInstrArray[i], ifsInstrArray[j]) )


    bool ifChecker::operEquiv(Instruction *I1, Instruction *I2){
     if (I1!=NULL && I2!=NULL)
       //if (I1->getOpcode() != I2->getOpcode()) return false;
         return true;

When I decomment the line from operEquiv, I have the segfault. See gdb

movzbl 0x4(%edx),%edx

What is the problem?
Thank you !

Best regards,
Alexandru Ionut Diaconescu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121221/c2cf8ac3/attachment.html>

More information about the llvm-dev mailing list