From fa09bebacbbb28c1bd8381c7c677ca0f046afc42 Mon Sep 17 00:00:00 2001 From: Mars Saxman Date: Mon, 26 Aug 2024 11:16:50 -0700 Subject: [PATCH] satisfy compiler's concern about mixed signed/unsigned comparison --- zirgen/dsl/passes/GenerateLayout.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zirgen/dsl/passes/GenerateLayout.cpp b/zirgen/dsl/passes/GenerateLayout.cpp index 8b638eaa..254fa5a3 100644 --- a/zirgen/dsl/passes/GenerateLayout.cpp +++ b/zirgen/dsl/passes/GenerateLayout.cpp @@ -110,7 +110,8 @@ class AllocationTable { int nextIndex(int n) { int next = storage.find_next_unset(n); size_t capacity = storage.getBitCapacity(); - if (next == -1 || next >= capacity) { + assert(next >= -1); + if (next == -1 || (size_t)next >= capacity) { storage.resize(2 * capacity); AllocationTable* ancestor = parent;