<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix"><tt>Hi Carlos,</tt><tt><br>
</tt><tt><br>
</tt><tt>Thanks for identifying the bug. </tt><tt><tt>I'll
confirm and fix.</tt> Is there a bug report open for this? </tt><tt><br>
</tt><tt><br>
</tt><tt>-Anshu</tt><tt><br>
</tt><tt><br>
</tt><tt>---
</tt><tt><br>
</tt><tt>Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation
</tt><tt><br>
</tt>
<tt><br>
</tt><tt><br>
</tt><tt><br>
</tt><tt>On 12/10/2012 4:48 AM, Carlos Sánchez de La Lama wrote:</tt><tt><br>
</tt></div>
<blockquote
cite="mid:CA+KcR8A1FAHVDvCfG_xQM=i4H9=GKfcp7dMg+Bn115oETUg8MA@mail.gmail.com"
type="cite"><tt>Hi all,</tt><tt><br>
</tt><tt><br>
</tt><tt>I have found what I think it is a bug in
DFAPacketizer::ReadTable.</tt><tt><br>
</tt><tt><br>
</tt><tt>When finding NextStateInTable to cache all transitions
belonging to a state into CachedTable, ReadTable does not check
bounds:</tt><tt><br>
</tt><tt><br>
</tt><tt>
unsigned ThisState =
DFAStateEntryTable[state];
|</tt><tt><br>
</tt><tt>unsigned NextStateInTable =
DFAStateEntryTable[state+1]; </tt><tt><br>
</tt><tt><br>
</tt><tt>which makes NextStateInTable get a random value when
state == <last state in table>. Behaviour changes
depending on gcc version / platform / ..., but in some cases
might lead to segmentation faults.</tt><tt><br>
</tt>
<tt><br>
</tt><tt>I have checked the problem happens in Hexagon tests (for
example fadd.ll test) but does not break badly there (though
CachedTable will get some unneded and random data rows).</tt><tt><br>
</tt><tt><br>
</tt><tt>Probably making tblgen add an end-of-table marker in
<Target>DFAStateEntryTable is the easiest solution.</tt><tt><br>
</tt>
<tt><br>
</tt><tt>BR</tt><tt><br>
</tt><tt><br>
</tt><tt>Carlos</tt><tt><br>
</tt>
<tt><br>
</tt>
<fieldset class="mimeAttachmentHeader"></fieldset>
<tt><br>
</tt>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<tt><br>
</tt>
</body>
</html>