Home GnuPG

Replace deliberate division by zero with _gcry_divide_by_zero.
2c54c4da19d3Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Replace deliberate division by zero with _gcry_divide_by_zero.

* mpi/mpi-pow.c: Replace 1 / msize.
* mpi/mpih-div.c: Replace 1 / dsize.
* src/misc.c: Add _gcry_divide_by_zero.
  1. Division by zero doesn't "provoke a signal" on architectures like PowerPC.
  1. C compilers like clang will optimize away these divisions, even though the code tries "to make the compiler not remove" them.

This patch redirects these cases to _gcry_divide_by_zero.

Details

Provenance
Xi Wang <xi.wang@gmail.com>Authored on Aug 15 2012, 12:54 AM
wernerCommitted on Aug 16 2012, 10:48 AM
Parents
rC2196728e2252: Clear AESNI feature flag for x86_64.
Branches
Unknown
Tags
Unknown