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

Negative index into stateTable? #113

Open
chhu opened this issue Jun 13, 2023 · 1 comment
Open

Negative index into stateTable? #113

chhu opened this issue Jun 13, 2023 · 1 comment

Comments

@chhu
Copy link

chhu commented Jun 13, 2023

This is more a question:
How can you guarantee that this index to stateTable cannot become negative?

statePtr->value = stateTable[ (statePtr->value >> nbBitsOut) + symbolTT.deltaFindState];

Thanks!

@madMAx43v3r
Copy link

I've gotten segfaults here as well, usually when using more than 128 symbols.

I changed the code to check for out of range index and throw an exception.

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

No branches or pull requests

2 participants