From c3c783424604b14cdd86950bf4b0aaded1f97316 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 28 Jul 2018 00:41:31 +0100 Subject: BigInt support in the constant system --- src/ir.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ir.cpp') 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); -- cgit v1.2.3