Skip to content

Commit 92a435a

Browse files
committed
Fix let ignoring const-ness
1 parent 6f7eede commit 92a435a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/common/scripting/backend/codegen.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12564,7 +12564,14 @@ FxExpression *FxLocalVariableDeclaration::Resolve(FCompileContext &ctx)
1256412564
{
1256512565
if (Init->IsStruct())
1256612566
{
12567-
ValueType = NewPointer(ValueType);
12567+
bool writable = true;
12568+
12569+
if(ctx.Version >= MakeVersion(4, 12, 0))
12570+
{
12571+
Init->RequestAddress(ctx, &writable);
12572+
}
12573+
12574+
ValueType = NewPointer(ValueType, !writable);
1256812575
Init = new FxTypeCast(Init, ValueType, false);
1256912576
SAFE_RESOLVE(Init, ctx);
1257012577
}

0 commit comments

Comments
 (0)