diff options
| author | gingerBill <ginger.bill.22@gmail.com> | 2016-08-05 00:54:05 +0100 |
|---|---|---|
| committer | gingerBill <ginger.bill.22@gmail.com> | 2016-08-05 00:54:05 +0100 |
| commit | 2aaef48c5c362bb3e04d0c9cd1e722e21b3755e5 (patch) | |
| tree | f7b99cda983ce6226384127672abea74459b05b3 /src/checker/expr.cpp | |
| parent | 19aea1f19895b035e8abb424987f48df6bc52c53 (diff) | |
String support
Diffstat (limited to 'src/checker/expr.cpp')
| -rw-r--r-- | src/checker/expr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/checker/expr.cpp b/src/checker/expr.cpp index 7a1fdb70e..4129e6e73 100644 --- a/src/checker/expr.cpp +++ b/src/checker/expr.cpp @@ -954,6 +954,7 @@ b32 check_index_value(Checker *c, AstNode *index_value, i64 max_count, i64 *valu } Entity *lookup_field(Type *type, AstNode *field_node, isize *index = NULL) { + GB_ASSERT(type != NULL); GB_ASSERT(field_node->kind == AstNode_Ident); type = get_base_type(type); if (type->kind == Type_Pointer) @@ -1192,7 +1193,7 @@ b32 check_builtin_procedure(Checker *c, Operand *operand, AstNode *call, i32 id) if (is_type_string(t)) { if (operand->mode == Addressing_Constant) { mode = Addressing_Constant; - value = make_exact_value_integer(operand->value.value_string.len); + value = make_exact_value_integer(operand->value.value_string); } else { mode = Addressing_Value; } @@ -1683,7 +1684,6 @@ ExpressionKind check__expr_base(Checker *c, Operand *o, AstNode *node, Type *typ if (o->mode == Addressing_Constant) { max_count = o->value.value_string.len; } - o->mode = Addressing_Value; o->type = t_u8; } break; @@ -1743,6 +1743,7 @@ ExpressionKind check__expr_base(Checker *c, Operand *o, AstNode *node, Type *typ if (o->mode == Addressing_Constant) { max_count = o->value.value_string.len; } + o->type = t_string; o->mode = Addressing_Value; } break; |