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

Attila Sztupák attila.sztupak at gmail.com
Sat Jan 30 15:23:39 UTC 2010


oh, I didn't include all the sources needed to compile the result c#, just
what's enough to see the problem. The included sources are part of our fork
of gherkin at http://github.com/techtalk/gherkin/tree/dotnet-port. I haven't
tried to compile it with mono yet, so I can't guarantee that you can get it
running.

Anyway, thanks for trying,
sztupi

On Thu, Jan 28, 2010 at 4:00 AM, Adrian Thurston <thurston at complang.org>wrote:

> I'm trying to reproduce by compiling with mono-gmcs, but I don't seem to
> have ILexer and the compilation stops there. Is that a system library or
> something from Gherkin?
>
> Attila Sztupák wrote:
> > Hi,
> >
> > 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 workaround?
> >
> > thx,
> > sztupi
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > ragel-users mailing list
> > ragel-users at complang.org
> > http://www.complang.org/mailman/listinfo/ragel-users
>
> _______________________________________________
> ragel-users mailing list
> ragel-users at complang.org
> http://www.complang.org/mailman/listinfo/ragel-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20100130/61309f6d/attachment-0001.html>


More information about the ragel-users mailing list