That attempts to put ns*ns doubles on the stack; I imagine that will make it pretty easy to generate a stack overflow with input using a large number of states.
This was flagged by the -Wvla compiler warning and indeed looks like a place where we may prefer heap allocation.
https://github.com/tagteam/prodlim/blob/4f8748df44777ce8f18d532e4c35ec4548b031ef/src/prodlim_multistates.c#L72
That attempts to put
ns*ns
doubles on the stack; I imagine that will make it pretty easy to generate a stack overflow with input using a large number of states.This was flagged by the
-Wvla
compiler warning and indeed looks like a place where we may prefer heap allocation.