-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code generated is unpredictably incorrect #93
Comments
FYI: I just updated the linked branch to circumvent the bug #91 (which you would hit first otherwise). Now, to replicate the behaviour I described above, just try building everything on with Happy 1.19.5 or HEAD, then compare the output of the test suite with or without the Again, since this is such a big test case, I'd be glad to help step through anything that is unclear in this bug report... |
The branch I linked in m first comment is definitely producing incorrect code. Here is the debug output (happy run with
Yet, in
Note that with the Here is my attempt at debugging so far:
This is as far as I managed to get so far with the time I've had. Hope it helps! :) |
Alright. I've found what the issue is. I don't think it is directly related to anything above (apologies for the wild goose-chase) and I'm really not sure what the best way is to deal with this (if there is even something to do). My Briefly, here are some thoughts about this:
I'll probably open a PR sometime in the next couple of days for the first and third points. |
This fails on versions of Happy before PR haskell#102 was merged and passes afterwards.
I've been running across what I think is the same bug several times in the last couple of months while working on a pretty big grammar. Here are some more extreme things I've witnessed that seem to indicate the code generated is incorrect:
I've made a branch here which is as reduced an example as I've managed to get. There is one test suite included which has exactly one test case. Right now, I think the code generated by Happy (1.19.5 and HEAD) is incorrect (the test should pass). However, commenting out the
pat_slice
production (which is used nowhere) makes the test pass again. In fact, as I've tried to reduce this grammar over the past weeks, I'm now finding it difficult to comment out anything without the test passing again.I realize this is a huge test case, but I am at a complete loss at what to do to reduce the grammar since doing so seems to remove the bug.
The text was updated successfully, but these errors were encountered: