[llvm-commits] bug fix proposal

Hans Vandierendonck hvdieren at elis.ugent.be
Tue Aug 24 10:37:16 PDT 2010


Hi,

I admit, I did not check. My client code wrongfully assumes that the  
malloc is inserted by CreateMalloc().

But on the other hand, what is the rationale for correctly inserting  
in place all but the last of the created instructions
(allocation size computation, call inst to malloc, cast inst)?
And what is the rationale for doing things differently with  
InsertBefore semantics, i.e. all instructions are inserted?

Is this an artifact remaining from the previously existing MallocInst?
If so, would it be acceptable to change the semantics of  
CreateMalloc() to always insert all instructions at the location  
requested?

Hans.

On Aug 24, 2010, at 7:04 PM, Nick Lewycky wrote:

> Hans Vandierendonck wrote:
>> Hi,
>>
>> The attached patch fixes a bug in lib/VMCore/Instructions.cpp,
>> createMalloc() routine, where a BitCastInst is not inserted in any
>> BasicBlock.
>
> Did you run 'make check' after writing this patch? I saw a lot of  
> failing unit tests that weren't failing before. I suspect you need  
> to audit the callers of createMalloc and make sure they aren't re- 
> inserting the resulting malloc, maybe?
>
> Nick

====
Hans Vandierendonck
Post-doctoral Fellow FWO
Department of Electronics and Information Systems
Ghent University
http://www.elis.ugent.be/~hvdieren/




More information about the llvm-commits mailing list