Skip to content

gmp_init(): Don't use leading 0x or 0b if different base specified #799

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

Closed
wants to merge 1 commit into from
Closed

gmp_init(): Don't use leading 0x or 0b if different base specified #799

wants to merge 1 commit into from

Conversation

plstand
Copy link
Contributor

@plstand plstand commented Sep 2, 2014

Fixes bugs #50175 and #55398.

Made pull request against master; backport to older branches if you wish.

@smalyshev @TazeTSchnitzel @nikic

@nikic
Copy link
Member

nikic commented Sep 2, 2014

This isn't right - if no base is specified (base 0) then hex and binary should be detected.

@nikic
Copy link
Member

nikic commented Sep 2, 2014

Now fixed via 834daa4.

@plstand
Copy link
Contributor Author

plstand commented Sep 2, 2014

@nikic, hex, binary, and octal are already detected by GMP itself when base == 0, so that's why I didn't bother checking that. Your version of the patch should still fix the bug, so closing this request.

@plstand plstand closed this Sep 2, 2014
@nikic
Copy link
Member

nikic commented Sep 2, 2014

@plstand You're absolutely right, I wasn't aware of that - thought the code was there to handle the base 0 case. I'll leave the extra comparisons in there for now, so people like myself don't get confused ^^

@MaideCa
Copy link

MaideCa commented Sep 2, 2014

@plstand The GMP prefix base detection only works when a base of 0 is given, so @nikic's current fix is the best solution as it won't break prefixed strings that specify a base.

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.

3 participants