[llvm-commits] Fixed crash in LiveVariables::runOnMachineFunction

Sean Gies sean.gies at caustic.com
Mon May 23 19:11:55 PDT 2011


Please see my comments in the bug database:

http://llvm.org/bugs/show_bug.cgi?id=9976

-Sean

----- Original Message -----
> I think the direct use of VirtRegInfo.size() is intentional here.
> Using getVarInfo() will grow the array to its maximum size, even if a
> lot of variables never got liveness information in the main loop. I
> would like to see an explanation of what is going wrong before I say
> this is okay.
> 
> 
> Cameron
> 
> 
> 
> On May 20, 2011, at 3:45 PM, Sean Gies wrote:
> 
> 
> 
> I see a crash in LiveVariables::runOnMachineFunction where it
> transfers the dead/kill information to machine instructions. The loop
> accesses memory past the end of an array.
> 
> This crash occurs only on Windows (VS2008 or VS2010) and only with
> Release or RelWithDebInfo builds. It does not occur in Debug builds,
> nor on Mac OS X or Linux.
> 
> I have attached a fix (w/ test case). I modified the loop to work like
> other similar iterations in the LiveVariables class, and to use the
> "getVarInfo()" method, which will grow the array in question as
> necessary, preventing the out-of-bounds access.
> 
> -Sean <fix-live-variables-crash.patch>
> _______________________________________________ llvm-commits mailing
> list llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list