[LLVMdev] Possible bug in DFAPacketizer::ReadTable
Carlos Sánchez de La Lama
csanchezdll at gmail.com
Mon Dec 10 02:48:24 PST 2012
I have found what I think it is a bug in DFAPacketizer::ReadTable.
When finding NextStateInTable to cache all transitions belonging to a state
into CachedTable, ReadTable does not check bounds:
unsigned ThisState =
unsigned NextStateInTable = DFAStateEntryTable[state+1];
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.
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).
Probably making tblgen add an end-of-table marker in
<Target>DFAStateEntryTable is the easiest solution.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev