diff options
| author | Andreas T Jonsson <mail@andreasjonsson.se> | 2024-05-02 09:27:46 +0200 |
|---|---|---|
| committer | Andreas T Jonsson <mail@andreasjonsson.se> | 2024-05-02 09:27:46 +0200 |
| commit | 7feff1c11335be9c0d804c3ca93050b7d154aad8 (patch) | |
| tree | 62c89fcafad6b6c9445cb37153e62a6b23223d39 /src/check_expr.cpp | |
| parent | 6bbdbb4447b0a2b5b485ae4351016b05ae79758f (diff) | |
| parent | fd582015fe2bbaabc42f78caefec1bd95f4d1465 (diff) | |
Merged with master
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index b893b3a00..06d0a8b12 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8079,11 +8079,10 @@ gb_internal void add_constant_switch_case(CheckerContext *ctx, SeenMap *seen, Op } uintptr key = hash_exact_value(operand.value); - TypeAndToken *found = map_get(seen, key); - if (found != nullptr) { + GB_ASSERT(key != 0); + isize count = multi_map_count(seen, key); + if (count) { TEMPORARY_ALLOCATOR_GUARD(); - - isize count = multi_map_count(seen, key); TypeAndToken *taps = gb_alloc_array(temporary_allocator(), TypeAndToken, count); multi_map_get_all(seen, key, taps); @@ -9406,7 +9405,8 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast * continue; } ExactValue v = f->Constant.value; - auto found = map_get(&seen, hash_exact_value(v)); + uintptr hash = hash_exact_value(v); + auto found = map_get(&seen, hash); if (!found) { array_add(&unhandled, f); } |