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

Cameron Zwarich zwarich at apple.com
Fri May 20 22:06:46 PDT 2011


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110520/323ccb0d/attachment.html>


More information about the llvm-commits mailing list