alliedmodders / sourcepawn

A small, statically typed scripting language.
Other
369 stars 63 forks source link

Behavior of enum struct and array #895

Closed idk1703 closed 11 months ago

idk1703 commented 1 year ago

master, 1.11-dev code:

enum struct A
{
    int b[1];
}

public void main()
{
    A a;
    a.b[0] = 0;
    a.b[0][0] = 0;
    a.b[0][0][0] = 0;
    a.b[0][0][0][0] = 0;
}

out:

SourcePawn Compiler 1.12
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2021 AlliedModders LLC

Code size:         3688 bytes
Data size:         2280 bytes
Stack/heap size:      16452 bytes
Total requirements:   22420 bytes
dvander commented 11 months ago

Thanks for the great test case, this has been fixed on master.