diff options
author | Piotr Fusik <piotr@fusion-lang.org> | 2024-02-29 16:06:34 +0100 |
---|---|---|
committer | Piotr Fusik <piotr@fusion-lang.org> | 2024-02-29 16:06:34 +0100 |
commit | 4a3977e9a8a097e31933e06dd54e592f2d3a6295 (patch) | |
tree | 66c5af6dec352246f6a9614d897e021db7ccd698 | |
parent | ba10fe047d4e1a6d0dc13cc2a14d34bd776f2e4a (diff) |
-rw-r--r-- | GenC.fu | 2 | ||||
-rw-r--r-- | libfut.cpp | 2 | ||||
-rw-r--r-- | libfut.cs | 2 | ||||
-rw-r--r-- | libfut.js | 2 | ||||
-rw-r--r-- | test/JsonElement.fu | 2 |
5 files changed, 5 insertions, 5 deletions
@@ -1953,7 +1953,7 @@ public class GenC : GenCCpp Write("_TryParse(&"); obj.Accept(this, FuPriority.Primary); Write(", "); - args[0].Accept(this, FuPriority.Argument); + WriteTemporaryOrExpr(args[0], FuPriority.Argument); if (obj.Type is FuIntegerType) WriteTryParseRadix(args); WriteChar(')'); @@ -10839,7 +10839,7 @@ void GenC::writeTryParse(const FuExpr * obj, const std::vector<std::shared_ptr<F write("_TryParse(&"); obj->accept(this, FuPriority::primary); write(", "); - (*args)[0]->accept(this, FuPriority::argument); + writeTemporaryOrExpr((*args)[0].get(), FuPriority::argument); if (dynamic_cast<const FuIntegerType *>(obj->type.get())) writeTryParseRadix(args); writeChar(')'); @@ -11140,7 +11140,7 @@ namespace Fusion Write("_TryParse(&"); obj.Accept(this, FuPriority.Primary); Write(", "); - args[0].Accept(this, FuPriority.Argument); + WriteTemporaryOrExpr(args[0], FuPriority.Argument); if (obj.Type is FuIntegerType) WriteTryParseRadix(args); WriteChar(')'); @@ -11525,7 +11525,7 @@ export class GenC extends GenCCpp this.write("_TryParse(&"); obj.accept(this, FuPriority.PRIMARY); this.write(", "); - args[0].accept(this, FuPriority.ARGUMENT); + this.#writeTemporaryOrExpr(args[0], FuPriority.ARGUMENT); if (obj.type instanceof FuIntegerType) this.writeTryParseRadix(args); this.writeChar(41); diff --git a/test/JsonElement.fu b/test/JsonElement.fu index 5d5119c..90f5c6e 100644 --- a/test/JsonElement.fu +++ b/test/JsonElement.fu @@ -352,7 +352,7 @@ public static class Test { public static bool Run() { - JsonElement# json; //FAIL: cl + JsonElement# json; //FAIL: c leak TODO; cl json = JsonElement.Parse("\"foo\""); if (!json.IsString() || json.GetString() != "foo") return false; |