aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-01-04 22:20:18 +0000
committergingerBill <bill@gingerbill.org>2023-01-04 22:20:18 +0000
commit9455918eec18f3101d040adea09a628f684563f9 (patch)
treea37cd9f0388fda66178991e7c641f99ad76b9a8d /src/checker.cpp
parent8a99b8af3e875141156d359026b785fcfd284f57 (diff)
Fix min dep type info problem caused by const ref of `map_set`
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 0bebce232..8cb6ea99d 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -2030,7 +2030,10 @@ gb_internal void add_min_dep_type_info(Checker *c, Type *t) {
// Type already exists;
return;
}
- map_set(set, ti_index, set->entries.count);
+ // IMPORTANT NOTE(bill): this must be copied as `map_set` takes a const ref
+ // and effectively assigns the `+1` of the value
+ isize const count = set->entries.count;
+ map_set(set, ti_index, count);
// Add nested types
if (t->kind == Type_Named) {