aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-11-05 16:45:27 +0000
committergingerBill <bill@gingerbill.org>2021-11-05 16:45:27 +0000
commit924faa58b43b5e727436cd50bded45b9c43ac3a4 (patch)
treefc57e83bf415f93c6ba875e6eb21f686f56962e0 /src/checker.cpp
parent6be104e5215668aad05c68cb26e1dd9fe898fc11 (diff)
Correct `map_remove(PtrMap)`
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 643673afe..044342760 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -1086,7 +1086,7 @@ Scope *scope_of_node(Ast *node) {
}
ExprInfo *check_get_expr_info(CheckerContext *c, Ast *expr) {
if (c->untyped != nullptr) {
- ExprInfo **found = map_get(c->untyped, hash_pointer(expr));
+ ExprInfo **found = map_get(c->untyped, expr);
if (found) {
return *found;
}
@@ -1094,7 +1094,7 @@ ExprInfo *check_get_expr_info(CheckerContext *c, Ast *expr) {
} else {
mutex_lock(&c->info->global_untyped_mutex);
defer (mutex_unlock(&c->info->global_untyped_mutex));
- ExprInfo **found = map_get(&c->info->global_untyped, hash_pointer(expr));
+ ExprInfo **found = map_get(&c->info->global_untyped, expr);
if (found) {
return *found;
}
@@ -1104,23 +1104,23 @@ ExprInfo *check_get_expr_info(CheckerContext *c, Ast *expr) {
void check_set_expr_info(CheckerContext *c, Ast *expr, AddressingMode mode, Type *type, ExactValue value) {
if (c->untyped != nullptr) {
- map_set(c->untyped, hash_pointer(expr), make_expr_info(mode, type, value, false));
+ map_set(c->untyped, expr, make_expr_info(mode, type, value, false));
} else {
mutex_lock(&c->info->global_untyped_mutex);
- map_set(&c->info->global_untyped, hash_pointer(expr), make_expr_info(mode, type, value, false));
+ map_set(&c->info->global_untyped, expr, make_expr_info(mode, type, value, false));
mutex_unlock(&c->info->global_untyped_mutex);
}
}
void check_remove_expr_info(CheckerContext *c, Ast *e) {
if (c->untyped != nullptr) {
- map_remove(c->untyped, hash_pointer(e));
- GB_ASSERT(map_get(c->untyped, hash_pointer(e)) == nullptr);
+ map_remove(c->untyped, e);
+ GB_ASSERT(map_get(c->untyped, e) == nullptr);
} else {
auto *untyped = &c->info->global_untyped;
mutex_lock(&c->info->global_untyped_mutex);
- map_remove(untyped, hash_pointer(e));
- GB_ASSERT(map_get(untyped, hash_pointer(e)) == nullptr);
+ map_remove(untyped, e);
+ GB_ASSERT(map_get(untyped, e) == nullptr);
mutex_unlock(&c->info->global_untyped_mutex);
}
}
@@ -4952,7 +4952,7 @@ void add_untyped_expressions(CheckerInfo *cinfo, UntypedExprInfoMap *untyped) {
return;
}
for_array(i, untyped->entries) {
- Ast *expr = cast(Ast *)cast(uintptr)untyped->entries[i].key.key;
+ Ast *expr = untyped->entries[i].key;
ExprInfo *info = untyped->entries[i].value;
if (expr != nullptr && info != nullptr) {
mpmc_enqueue(&cinfo->checker->global_untyped_queue, UntypedExprInfo{expr, info});