about summary refs log tree commit diff
path: root/src/libstore/globals.cc
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2016-10-26T15·09+0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2016-10-26T15·41+0300
commitf0fc3dd88b05866c4f6343d3c64ae1a4de4b8c9c (patch)
tree6f0193766b56cd0286f38c2528db9e891f625098 /src/libstore/globals.cc
parent5c0bd51d49a5022e83c17301bd03d4ce53cca98a (diff)
Fix SIGFPE from integer overflow during division
On some architectures (like x86_64 or i686, but not ARM for example)
overflow during integer division causes a crash due to SIGFPE.
Reproduces on a 64-bit system with:

    nix-instantiate --eval -E '(-9223372036854775807 - 1) / -1'

The only way this can happen is when the smallest possible integer is
divided by -1, so just special-case that.
Diffstat (limited to 'src/libstore/globals.cc')
0 files changed, 0 insertions, 0 deletions