Skip to content

Commit

Permalink
Fix let ignoring const-ness
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 committed Apr 19, 2024
1 parent 6f7eede commit 92a435a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/common/scripting/backend/codegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12564,7 +12564,14 @@ FxExpression *FxLocalVariableDeclaration::Resolve(FCompileContext &ctx)
{
if (Init->IsStruct())
{
ValueType = NewPointer(ValueType);
bool writable = true;

if(ctx.Version >= MakeVersion(4, 12, 0))
{
Init->RequestAddress(ctx, &writable);
}

ValueType = NewPointer(ValueType, !writable);
Init = new FxTypeCast(Init, ValueType, false);
SAFE_RESOLVE(Init, ctx);
}
Expand Down

0 comments on commit 92a435a

Please sign in to comment.