Hi all,<br><br>I have found what I think it is a bug in DFAPacketizer::ReadTable.<br><br>When finding NextStateInTable to cache all transitions belonging to a state into CachedTable, ReadTable does not check bounds:<br><br>
unsigned ThisState = DFAStateEntryTable[state]; |<br>unsigned NextStateInTable = DFAStateEntryTable[state+1]; <br><br>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.<br>
<br>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).<br><br>Probably making tblgen add an end-of-table marker in <Target>DFAStateEntryTable is the easiest solution.<br>
<br>BR<br><br>Carlos<br>