aboutsummaryrefslogtreecommitdiff
path: root/src/checker.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-02-11 11:13:52 +0000
committergingerBill <bill@gingerbill.org>2018-02-11 11:13:52 +0000
commit0ae3484171ec6f2876c1ff16102c8e92853c6632 (patch)
tree5668ecd8b4cf809ef31de61b55f6806731e91d2a /src/checker.cpp
parent54976c3249065e846ec29588c5c69e7013fe1e8f (diff)
Fix zero value initialization in IR
Diffstat (limited to 'src/checker.cpp')
-rw-r--r--src/checker.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/checker.cpp b/src/checker.cpp
index 2dec1a7c7..d0495e2d3 100644
--- a/src/checker.cpp
+++ b/src/checker.cpp
@@ -782,7 +782,7 @@ void add_untyped(CheckerInfo *i, AstNode *expression, bool lhs, AddressingMode m
if (mode == Addressing_Constant && type == t_invalid) {
compiler_error("add_untyped - invalid type: %s", type_to_string(type));
}
- map_set(&i->untyped, hash_node(expression), make_expr_info(lhs, mode, type, value));
+ map_set(&i->untyped, hash_node(expression), make_expr_info(mode, type, value, lhs));
}
void add_type_and_value(CheckerInfo *i, AstNode *expression, AddressingMode mode, Type *type, ExactValue value) {
@@ -880,14 +880,14 @@ void add_entity_and_decl_info(Checker *c, AstNode *identifier, Entity *e, DeclIn
GB_ASSERT(identifier->kind == AstNode_Ident);
GB_ASSERT(e != nullptr && d != nullptr);
GB_ASSERT(identifier->Ident.token.string == e->token.string);
- if (e->scope != nullptr) add_entity(c, e->scope, identifier, e);
+ if (e->scope != nullptr) {
+ add_entity(c, e->scope, identifier, e);
+ }
add_entity_definition(&c->info, identifier, e);
GB_ASSERT(e->decl_info == nullptr);
e->decl_info = d;
array_add(&c->info.entities, e);
e->order_in_src = c->info.entities.count;
- // map_set(&c->info.entities, hash_entity(e), d);
- // e->order_in_src = c->info.entities.entries.count;
}