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

src/dfa/ pack() tweaks #224

merged 2 commits into from Oct 22, 2018


Copy link

commented Oct 22, 2018

No description provided.

trofi added some commits Oct 22, 2018

src/dfa/ fix signed shift overflow
signed shift overflow is not defined by C standard.
clang++ -fsanitize=undefined detects it as:

src/dfa/ runtime error: left shift of negative value -1

This change wraps bit shift arithmetics into unsigned types.

Signed-off-by: Sergei Trofimovich <>
src/dfa/ fix pack() to drop two highest bits
longest | (leftmost << 30);
assumes `longest` does not exceed 30 bits. It could if
it's a negative value originally.

Signed-off-by: Sergei Trofimovich <>

@skvadrik skvadrik merged commit 22b73ed into skvadrik:master Oct 22, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

This comment has been minimized.

Copy link

commented Oct 22, 2018

Merged! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.