[ragel-users] arithmetic overflow in generated C# code

Attila Sztup√°k attila.sztupak at gmail.com
Wed Jan 27 09:46:58 UTC 2010


We've run into a possible bug in the c# code generation - for a set of input
files (http://gist.github.com/287694), the generated _lexer_actions table
have a length of 130, while the generated type of the indexers (_acts and
__acts) is sbyte ([-128..127]), causing an overflow (and an index out of
range exception afterwards) when executing the actions. Using Java as
output, or changing the types of these variables to short in C# result
in the generated machine working as expected. Based on the sources, for all
output languages except C#, these indexers have a hardcoded type of UINT.

Can someone please confirm whether it's really a bug, and/or if there's any

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20100127/a0aa7e4d/attachment-0001.html>

More information about the ragel-users mailing list