Skip to content
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

Correctly reset the goto table for a state. #200

Closed
wants to merge 1 commit into from

Conversation

millert
Copy link
Contributor

@millert millert commented Oct 6, 2023

We cannot use set_gototab() to reset all the entries for a state, it will leave existing entries as-is. Add a new reset_gototab() function that zeroes the table entries for the specified state. There is no need to reset the goto table immediately after resize_state(), it is already initialized via calloc().

We cannot use set_gototab() to reset all the entries for a state,
it will leave existing entries as-is.  Add a new reset_gototab()
function that zeroes the table entries for the specified state.
There is no need to reset the goto table immediately after
resize_state(), it is already initialized via calloc().
@millert
Copy link
Contributor Author

millert commented Oct 6, 2023

This has been confirmed by @enh-google to fix #199

@millert millert changed the base branch from master to staging October 6, 2023 22:23
@plan9
Copy link
Collaborator

plan9 commented Oct 7, 2023

This has been confirmed by @enh-google to fix #199

I can reproduce the problem trivially. I know for a fact that this PR cannot fix #199.
as per kernighan's note, it has to do with the size of the gototab.

@plan9 plan9 closed this Oct 7, 2023
@enh-google
Copy link
Contributor

This has been confirmed by @enh-google to fix #199

I can reproduce the problem trivially. I know for a fact that this PR cannot fix #199. as per kernighan's note, it has to do with the size of the gototab.

well, having tested this patch with the specific input that caused me to raise #199, it definitely does fix that issue. it may introduce other problems, but nothing that our testing finds. do you have an example input that fails with this patch?

@millert millert deleted the reset_gototab branch October 31, 2023 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants