Fix let ignoring const-ness

This commit is contained in:
Ricardo Luís Vaz Silva 2024-04-19 13:27:08 -03:00
parent 7a1342188a
commit 949cd5b746

View file

@ -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);
}