Skip to content

Commit

Permalink
[c] Mark a leak.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Feb 29, 2024
1 parent ba10fe0 commit 4a3977e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion GenC.fu
Original file line number Diff line number Diff line change
Expand Up @@ -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(')');
Expand Down
2 changes: 1 addition & 1 deletion libfut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(')');
Expand Down
2 changes: 1 addition & 1 deletion libfut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11140,7 +11140,7 @@ void WriteTryParse(FuExpr obj, List<FuExpr> args)
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(')');
Expand Down
2 changes: 1 addition & 1 deletion libfut.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion test/JsonElement.fu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4a3977e

Please sign in to comment.