<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>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.</div><div><br></div><div>Cameron</div><div><br><div><div>On May 20, 2011, at 3:45 PM, Sean Gies wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">

  

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  
  <div text="#000000" bgcolor="#ffffff">
    <span class="Apple-style-span" style="border-collapse: separate; font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: Verdana,sans-serif;
        font-size: small;">
        <pre class="bz_comment_text" id="comment_text_0" style="font-size: medium; font-family: monospace; white-space: pre-wrap; width: 50em;">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

</pre>
      </span></span>
  </div>

<span><fix-live-variables-crash.patch></span>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote></div><br></div></body></html>