From 605c77e04317e5fbc25be3200b913af95cb56850 Mon Sep 17 00:00:00 2001 From: Jose Mendoza <56417208+StunxFS@users.noreply.github.com> Date: Mon, 4 Dec 2023 12:50:18 -0400 Subject: [PATCH] Update __init__.py --- rivetc/src/codegen/__init__.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rivetc/src/codegen/__init__.py b/rivetc/src/codegen/__init__.py index 6b625d087..56536d144 100644 --- a/rivetc/src/codegen/__init__.py +++ b/rivetc/src/codegen/__init__.py @@ -1566,14 +1566,14 @@ def gen_expr(self, expr, custom_tmp = None): if expr.index.has_start: start = self.gen_expr(expr.index.start) else: - start = ir.IntLit(ir.UINT_T, "0") + start = ir.IntLit(ir.INT_T, "0") if expr.index.has_end: end = self.gen_expr(expr.index.end) else: if s.kind == TypeKind.Array: - end = ir.IntLit(ir.UINT_T, s.info.size.lit) + end = ir.IntLit(ir.INT_T, s.info.size.lit) elif isinstance(left, ir.StringLit): - end = ir.IntLit(ir.UINT_T, left.len) + end = ir.IntLit(ir.INT_T, left.len) else: end = None tmp = self.cur_fn.local_name() @@ -1614,8 +1614,8 @@ def gen_expr(self, expr, custom_tmp = None): ir.InstKind.Call, [ ir.Name("_R4core16array_slice_fromF"), ir.Inst(ir.InstKind.GetRef, [left]), - ir.IntLit(ir.UINT_T, str(size)), - ir.IntLit(ir.UINT_T, s.info.size.lit), start + ir.IntLit(ir.INT_T, str(size)), + ir.IntLit(ir.INT_T, s.info.size.lit), start ] ) else: @@ -1623,8 +1623,8 @@ def gen_expr(self, expr, custom_tmp = None): ir.InstKind.Call, [ ir.Name("_R4core11array_sliceF"), ir.Inst(ir.InstKind.GetRef, [left]), - ir.IntLit(ir.UINT_T, str(size)), - ir.IntLit(ir.UINT_T, s.info.size.lit), start, + ir.IntLit(ir.INT_T, str(size)), + ir.IntLit(ir.INT_T, s.info.size.lit), start, end ] ) @@ -1634,7 +1634,7 @@ def gen_expr(self, expr, custom_tmp = None): if isinstance(s.info, sym.ArrayInfo): self.cur_fn.add_call( "_R4core11array_indexF", - [ir.IntLit(ir.UINT_T, s.info.size.lit), idx] + [ir.IntLit(ir.INT_T, s.info.size.lit), idx] ) tmp = self.cur_fn.local_name() expr_typ_ir = self.ir_type(expr.typ)