From ee8809a3932caa435c7e809638154469886f01b6 Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 19 Jul 2024 22:22:35 +0200 Subject: [PATCH] fixed uninit err in backend --- src/llvm/llvm-ir/types.c | 2 +- tests/input_file/test.gem | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/llvm/llvm-ir/types.c b/src/llvm/llvm-ir/types.c index f699e97..c64ed6e 100644 --- a/src/llvm/llvm-ir/types.c +++ b/src/llvm/llvm-ir/types.c @@ -321,7 +321,7 @@ BackendError impl_types(LLVMBackendCompileUnit* unit, LLVMGlobalScope* scope, gpointer key = NULL; gpointer val = NULL; - BackendError err; + BackendError err = SUCCESS; while (g_hash_table_iter_next(&iterator, &key, &val) != FALSE) { err = impl_type_define(unit, (Typedefine*) val, (const char*)key, scope); diff --git a/tests/input_file/test.gem b/tests/input_file/test.gem index 991288d..3479ad3 100644 --- a/tests/input_file/test.gem +++ b/tests/input_file/test.gem @@ -1,6 +1,4 @@ -import "std.io" - -fun main { - print("Hello, World!!!") -} \ No newline at end of file +fun main(out int: ret) { + ret = 56 as int +}