Document assumptions that are being made to avoid division by zero #11133

pull practicalswift wants to merge 1 commits into bitcoin:master from practicalswift:div0 changing 3 files +3 −0
  1. practicalswift commented at 2:01 PM on August 25, 2017: contributor

    Document assumptions (via assert(…):s) that are being made to avoid division by zero.

    Rationale:

    • Make it clear to human reviewers and non-human static analyzers that what might look like potential division by zero cases are written the way they are intentionally (these cases are currently flagged by various static analyzers).
  2. practicalswift renamed this:
    Document assumptions that must be fulfilled to avoid division by zero
    Document assumptions that are being made to avoid division by zero
    on Aug 25, 2017
  3. practicalswift force-pushed on Aug 25, 2017
  4. laanwj added the label Refactoring on Aug 26, 2017
  5. meshcollider commented at 12:52 PM on August 26, 2017: contributor

    Hmm does adding that text change the behavior of the static analyzers? Otherwise it seems pretty human readable to me already, they aren't exactly complicated asserts :)

  6. meshcollider cross-referenced this on Aug 26, 2017 from issue Document assumptions that are being made to avoid NULL pointer dereferences by practicalswift
  7. sipa commented at 7:31 PM on August 27, 2017: member

    Agree with @MeshCollider.

  8. danra commented at 9:31 PM on August 27, 2017: contributor

    utACK for asserting != 0 where added. Agree with @MeshCollider that the extra text is redundant.

  9. Document assumptions that are being made to avoid division by zero 55509f1a11
  10. practicalswift force-pushed on Aug 28, 2017
  11. practicalswift commented at 7:25 AM on August 28, 2017: contributor

    @MeshCollider @sipa @danra Thanks for reviewing! Redundant comments removed. Looks good? :-)

  12. fanquake cross-referenced this on Oct 12, 2017 from issue Codeai fixes: remove dead code, prevent possible division by zero. by C0deAi
  13. laanwj commented at 11:40 AM on October 12, 2017: member

    utACK 55509f1

  14. laanwj merged this on Oct 12, 2017
  15. laanwj closed this on Oct 12, 2017

  16. laanwj referenced this in commit a865b38bf3 on Oct 12, 2017
  17. MarcoFalke cross-referenced this on Oct 15, 2017 from issue Assertion fail when opening coin control dialog by mzhou
  18. jonasschnelli cross-referenced this on Oct 16, 2017 from issue Fix crash via division by zero assertion by jonasschnelli
  19. laanwj referenced this in commit ffa5159cef on Oct 18, 2017
  20. jasonbcox referenced this in commit 602b5fd67d on Jul 25, 2019
  21. jonspock referenced this in commit 9240e5b16f on Sep 5, 2019
  22. jonspock referenced this in commit cf753775d9 on Sep 6, 2019
  23. proteanx referenced this in commit 6c9f75b82b on Sep 6, 2019
  24. PastaPastaPasta referenced this in commit 0f6d7f029b on Dec 22, 2019
  25. PastaPastaPasta referenced this in commit 37482b673c on Dec 22, 2019
  26. PastaPastaPasta referenced this in commit 78d0dcf26d on Jan 2, 2020
  27. PastaPastaPasta referenced this in commit e6583f1493 on Jan 2, 2020
  28. PastaPastaPasta referenced this in commit a760669f55 on Jan 4, 2020
  29. PastaPastaPasta referenced this in commit 73dfcc1b8b on Jan 4, 2020
  30. PastaPastaPasta referenced this in commit 4ff04d2fa1 on Jan 12, 2020
  31. PastaPastaPasta referenced this in commit 48674d576d on Jan 12, 2020
  32. PastaPastaPasta referenced this in commit e39ec04f50 on Jan 12, 2020
  33. PastaPastaPasta referenced this in commit d081812092 on Jan 12, 2020
  34. PastaPastaPasta referenced this in commit 3b4f241e76 on Jan 12, 2020
  35. PastaPastaPasta referenced this in commit 04d29ce352 on Jan 12, 2020
  36. PastaPastaPasta referenced this in commit 35d8343163 on Jan 12, 2020
  37. PastaPastaPasta referenced this in commit 16e8ca699a on Jan 12, 2020
  38. PastaPastaPasta referenced this in commit e21ae89c5b on Jan 12, 2020
  39. PastaPastaPasta referenced this in commit 6590d1dcb5 on Jan 12, 2020
  40. PastaPastaPasta referenced this in commit 078638d3a6 on Jan 12, 2020
  41. PastaPastaPasta referenced this in commit 93e979e4d4 on Jan 12, 2020
  42. PastaPastaPasta referenced this in commit 1665e724e2 on Jan 12, 2020
  43. PastaPastaPasta referenced this in commit 467c52c75f on Jan 16, 2020
  44. ckti referenced this in commit ea8a468b71 on Mar 28, 2021
  45. ckti referenced this in commit 117b62c705 on Mar 28, 2021
  46. practicalswift deleted the branch on Apr 10, 2021
  47. gades referenced this in commit 0ccc384401 on Feb 22, 2022
  48. gades referenced this in commit 43d71f5cda on Feb 22, 2022
  49. bitcoin locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:55 UTC