summaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/bytealloc.myr2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/bytealloc.myr b/lib/std/bytealloc.myr
index 4cd2b67..c16761d 100644
--- a/lib/std/bytealloc.myr
+++ b/lib/std/bytealloc.myr
@@ -405,7 +405,7 @@ const bitpos : byte[32] = [
const bktnum = {sz
var n, v
- v = (sz >> 3 : uint32)
+ v = sz > 0 ? ((sz - 1) >> 3 : uint32) : 0
v |= v >> 1
v |= v >> 2
v |= v >> 4