Skip to content

Commit

Permalink
[c] Revert temporary dynamic references for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
pfusik committed Mar 12, 2024
1 parent 5e5bff6 commit f8239cf
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 @@ -1052,7 +1052,7 @@ public class GenC : GenCCpp
void WriteStorageTemporary!(FuExpr expr)
{
if (expr.IsNewString(false)
|| (expr is FuCallExpr && expr.Type is FuOwningType))
|| (expr is FuCallExpr && expr.Type is FuStorageType))
WriteCTemporary(expr.Type, expr);
}

Expand Down
2 changes: 1 addition & 1 deletion libfut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9958,7 +9958,7 @@ int GenC::writeCTemporary(const FuType * type, const FuExpr * expr)

void GenC::writeStorageTemporary(const FuExpr * expr)
{
if (expr->isNewString(false) || (dynamic_cast<const FuCallExpr *>(expr) && dynamic_cast<const FuOwningType *>(expr->type.get())))
if (expr->isNewString(false) || (dynamic_cast<const FuCallExpr *>(expr) && dynamic_cast<const FuStorageType *>(expr->type.get())))
writeCTemporary(expr->type.get(), expr);
}

Expand Down
2 changes: 1 addition & 1 deletion libfut.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10260,7 +10260,7 @@ int WriteCTemporary(FuType type, FuExpr expr)

void WriteStorageTemporary(FuExpr expr)
{
if (expr.IsNewString(false) || (expr is FuCallExpr && expr.Type is FuOwningType))
if (expr.IsNewString(false) || (expr is FuCallExpr && expr.Type is FuStorageType))
WriteCTemporary(expr.Type, expr);
}

Expand Down
2 changes: 1 addition & 1 deletion libfut.js
Original file line number Diff line number Diff line change
Expand Up @@ -10602,7 +10602,7 @@ export class GenC extends GenCCpp

#writeStorageTemporary(expr)
{
if (expr.isNewString(false) || (expr instanceof FuCallExpr && expr.type instanceof FuOwningType))
if (expr.isNewString(false) || (expr instanceof FuCallExpr && expr.type instanceof FuStorageType))
this.#writeCTemporary(expr.type, expr);
}

Expand Down
2 changes: 1 addition & 1 deletion test/MethodArgTempDynamic.fu
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Test

public static bool Run()
{
Consume(Create());
Consume(Create()); //FAIL: c leak TODO
return true;
}
}

0 comments on commit f8239cf

Please sign in to comment.