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

CBigNum: Convert negative int64 values in a more well-defined way #1497

Merged
merged 1 commit into from
Jul 11, 2012

Conversation

luke-jr
Copy link
Member

@luke-jr luke-jr commented Jun 21, 2012

Since the minimum signed integer cannot be represented as positive so long as its type is signed, and it's not well-defined what happens if you make it unsigned before negating it, we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate

@wizeman recently introduced this potential-bug in #1298, so I'd appreciate if he could comment (did not get a response on IRC)

Since the minimum signed integer cannot be represented as positive so long as its type is signed, and it's not well-defined what happens if you make it unsigned before negating it, we instead increment the negative integer by 1, convert it, then increment the (now positive) unsigned integer by 1 to compensate
@luke-jr luke-jr mentioned this pull request Jul 11, 2012
gmaxwell added a commit that referenced this pull request Jul 11, 2012
CBigNum: Convert negative int64 values in a more well-defined way
@gmaxwell gmaxwell merged commit 3dbca25 into bitcoin:master Jul 11, 2012
nifgraup pushed a commit to nifgraup/auroracoin-project that referenced this pull request Mar 30, 2014
CBigNum: Convert negative int64 values in a more well-defined way
suprnurd pushed a commit to chaincoin-legacy/chaincoin that referenced this pull request Dec 5, 2017
Adds several unittests for CAddrMan and CAddrInfo.
Increases the accuracy of addrman tests.
Removes non-determinism in tests by overriding the random number generator.
Extracts testing code from addrman class to test class.
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request Jan 22, 2019
lateminer pushed a commit to lateminer/bitcoin that referenced this pull request May 6, 2020
…ist-conf

8efee92 [Trivial][RPC] Remove references to old command list-conf (random-zebra)

Pull request description:

  `startmasternode` and `createmasternodebroadcast` error outputs are still
  referencing old command `list-conf` (deprecated since version v2.3.1).
  Replace with `listmasternodeconf`.

  Closes bitcoin#1496

ACKs for top commit:
  furszy:
    utACK 8efee92
  Fuzzbawls:
    utACK 8efee92

Tree-SHA512: 882a6bc00d8af03408f7894486b7e4b7e9ebd28cdf3b9876aa47ccecc6440d657b1d2a47e9cf26ec8a013fbaf788fe48cb934493fee5819468e4abcfc77f4d1f
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants