From 641377abfe86e9dc73309f57992d9f29ecfd73a9 Mon Sep 17 00:00:00 2001 From: Vic Nightfall Date: Sun, 5 May 2024 19:02:49 +0200 Subject: [PATCH] Breaking change --- src/eval.pr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/eval.pr b/src/eval.pr index ae8f6f5c..fc694b0e 100644 --- a/src/eval.pr +++ b/src/eval.pr @@ -131,7 +131,7 @@ export def get(mem: *, tpe: &typechecking::Type) -> compiler::Value { return [ kind = compiler::ValueKind::POINTER, tpe = tpe, i = @(mem !*int64) ] !compiler::Value case typechecking::TypeKind::REFERENCE, typechecking::TypeKind::WEAK_REF let values = allocate_ref(compiler::Value, 3) - values(0) = [ kind = compiler::ValueKind::POINTER, tpe = typechecking::pointer(builtins::size_t_), i = @(mem !*int64) ] !compiler::Value + values(0) = [ kind = compiler::ValueKind::POINTER, tpe = typechecking::pointer(compiler::ref_meta()), i = @(mem !*int64) ] !compiler::Value values(1) = [ kind = compiler::ValueKind::POINTER, tpe = typechecking::pointer(tpe.tpe), i = @((mem ++ (size_of type *)) !*int64) ] !compiler::Value values(2) = [ kind = compiler::ValueKind::POINTER, tpe = typechecking::pointer(builtins::Type_), i = @((mem ++ (size_of type *) * 2) !*int64) ] !compiler::Value return [ kind = compiler::ValueKind::STRUCT, tpe = tpe, values = values ] !compiler::Value @@ -364,7 +364,7 @@ def unwrap_undef(value: compiler::Value) -> compiler::Value { value = [ kind = compiler::ValueKind::ARRAY, tpe = value.tpe, values = values ] !compiler::Value } else if value.tpe.kind == typechecking::TypeKind::REFERENCE or value.tpe.kind == typechecking::TypeKind::WEAK_REF { let values = allocate_ref(compiler::Value, 3) - values(0) = [ kind = compiler::ValueKind::UNDEF, tpe = typechecking::pointer(builtins::size_t_) ] !compiler::Value + values(0) = [ kind = compiler::ValueKind::UNDEF, tpe = typechecking::pointer(compiler::ref_meta()) ] !compiler::Value values(1) = [ kind = compiler::ValueKind::UNDEF, tpe = typechecking::pointer(value.tpe.tpe) ] !compiler::Value values(2) = [ kind = compiler::ValueKind::UNDEF, tpe = typechecking::pointer(builtins::Type_) ] !compiler::Value value = [ kind = compiler::ValueKind::STRUCT, tpe = value.tpe, values = values ] !compiler::Value @@ -469,7 +469,7 @@ def eval_GetElementPtr(insn: &compiler::Insn, state: &State) { } } else if tpe.kind == typechecking::TypeKind::REFERENCE { if index == 0 { - tpe = typechecking::pointer(builtins::size_t_) + tpe = typechecking::pointer(compiler::ref_meta()) } else if index == 1 { addr = addr ++ (size_of type *) tpe = tpe.tpe