From e7aa16183a0d427aacc7d0c86ec394740069d87e Mon Sep 17 00:00:00 2001 From: nub31 Date: Wed, 2 Jul 2025 23:44:59 +0200 Subject: [PATCH] ... --- example/src/main.nub | 6 +----- src/compiler/Generation/QBE/QBEGenerator.cs | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/example/src/main.nub b/example/src/main.nub index a77314f..03b53d0 100644 --- a/example/src/main.nub +++ b/example/src/main.nub @@ -8,11 +8,7 @@ struct Human export func main(args: []cstring): i64 { - let x: cstring - - x = "john" - - c::puts(x) + c::puts("john") return 0 } diff --git a/src/compiler/Generation/QBE/QBEGenerator.cs b/src/compiler/Generation/QBE/QBEGenerator.cs index 49c743e..ab2ccd0 100644 --- a/src/compiler/Generation/QBE/QBEGenerator.cs +++ b/src/compiler/Generation/QBE/QBEGenerator.cs @@ -1297,9 +1297,6 @@ public static class QBEGenerator foreach (var parameter in funcCall.Parameters) { - var result = EmitUnwrap(EmitExpression(parameter)); - var copy = EmitCopy(parameter.Type, result); - var qbeType = parameter.Type switch { NubArrayType => "l", @@ -1326,6 +1323,7 @@ public static class QBEGenerator _ => throw new NotSupportedException($"'{parameter.Type}' type cannot be used in function calls") }; + var copy = EmitCopy(parameter.Type, EmitUnwrap(EmitExpression(parameter))); parameterStrings.Add($"{qbeType} {copy}"); }