aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2024-06-17 13:18:05 +0200
committerQuentin Carbonneaux <[email protected]>2024-06-17 13:24:22 +0200
commit0631bc4fecf9a9f96c8a520ac56371a0a86318b9 (patch)
treed0a0515838dd8393d292e423b362e8327a2f9018
parente7ebdc8fb66e04717b15af4cf6719ae23b03aad1 (diff)
prevent bogus simplifications
-rw-r--r--simpl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/simpl.c b/simpl.c
index 99e09df..7186d2f 100644
--- a/simpl.c
+++ b/simpl.c
@@ -51,7 +51,7 @@ ulog2(uint64_t pow2)
static int
ispow2(uint64_t v)
{
- return (v & (v - 1)) == 0;
+ return v && (v & (v - 1)) == 0;
}
static void