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

Sean Gies sean at caustic.com
Fri May 20 15:45:50 PDT 2011


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110520/512ea810/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-live-variables-crash.patch
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110520/512ea810/attachment.ksh>


More information about the llvm-commits mailing list