[LLVMdev] llvm segfault Instruction::getOpcode

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


Hello,

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 {
    public:
        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]) )
       ...

and

    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
output:

    0xb7fd6ff0
<_ZN12_GLOBAL__N_19ifChecker9operEquivEPN4llvm11InstructionES3_+16>:
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