-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
type X = object
v: array[1024*1024*8, int]
proc f(): X =
result.v[0] = 1
var x = (ref X)()
x[] = f()
echo x.v[0]note how huge object is placed on stack, crashing the application on linux (which has an 8mb default stack size)
N_LIB_PRIVATE N_NIMCALL(tyObject_X__KqwtR1mZdQ5eNccTtsN3pA, f__KQQBzps5MRoTwkbIifdBMQ)(void) {
tyObject_X__KqwtR1mZdQ5eNccTtsN3pA result;
...
return result;
[arnetheduck@tempus tmp]$ nim --version
Nim Compiler Version 1.2.0 [Linux: amd64]
Compiled at 2020-04-03
Copyright (c) 2006-2020 by Andreas Rumpf
active boot switches: -d:release