aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2018-07-28 00:41:31 +0100
committergingerBill <bill@gingerbill.org>2018-07-28 00:41:31 +0100
commitc3c783424604b14cdd86950bf4b0aaded1f97316 (patch)
treecf8eb6d5f40545bdd63c2b8f81ffa645119e8473 /src/ir.cpp
parentd0e04bf569465196e0679bf068126988dcab5122 (diff)
BigInt support in the constant system
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 75fd2c592..98bfbb99f 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -4778,7 +4778,7 @@ irValue *ir_build_builtin_proc(irProcedure *proc, Ast *expr, TypeAndValue tv, Bu
GB_ASSERT(is_type_integer(tv.type));
GB_ASSERT(tv.value.kind == ExactValue_Integer);
- i32 src_index = cast(i32)tv.value.value_integer;
+ i32 src_index = cast(i32)big_int_to_i64(&tv.value.value_integer);
i32 dst_index = i-1;
irValue *src_elem = ir_emit_array_epi(proc, src, src_index);
@@ -5639,7 +5639,7 @@ irAddr ir_build_addr(irProcedure *proc, Ast *expr) {
Type *selector_type = base_type(type_of_expr(se->selector));
GB_ASSERT_MSG(is_type_integer(selector_type), "%s", type_to_string(selector_type));
ExactValue val = type_and_value_of_expr(sel).value;
- i64 index = val.value_integer;
+ i64 index = big_int_to_i64(&val.value_integer);
Selection sel = lookup_field_from_index(type, index);
GB_ASSERT(sel.entity != nullptr);