sourcepawn icon indicating copy to clipboard operation
sourcepawn copied to clipboard

master OOMs on excessive array dims.

Open Fyren opened this issue 4 years ago • 1 comments

On my Windows machine, the following fails an allocation at some point:

public void main() { int ultimate_power[2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2][2]; }

I think it was here: https://github.com/alliedmodders/sourcepawn/blob/840c2f934b3884faf02bb7eb614d2a41a2f2e945/compiler/array-helpers.cpp#L888

Fyren avatar Aug 15 '21 17:08 Fyren

Maybe we should quickly compute the total memory size (if we don't already) and cap it at like 2^29 or something.

dvander avatar Aug 15 '21 20:08 dvander