[LLVMbugs] Potential bug in lli

Chris Lattner sabre at nondot.org
Sun Apr 13 09:07:38 PDT 2003


> I am working on an assignment for an advanced compiler's course at UNSW in
> Sydney, Australia. Our task is to write a scalar replacement pass for
> structs. In doing this, I think I have discovered a bug in lli. The
> problem only occurs after it has finished executing my .bc file. I have
> included this file for you. After lli has executed the final "ret"

I don't see this behavior.  On my machine, I get:
$ lli scalarise.bc
testSimple: 10
testCyclic: 20 30 40
testNestedStruct: 50 0.142857 (nil) (nil)
testNestedArray: 60 0.571428 65 0.285714
testCompare: 70
DONE

Because of this, I would guess that you are causing some kind of undefined
behavior.  In particular you may be free'ing memory allocated with the
'alloca' instruction, or you may be multiply free'ing memory, or you may
be freeing a pointer that was not allocated with malloc (offset with a
getelementptr in some way).

Hope this helps,

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-bugs mailing list