The program crashes under the following conditions:
The module has a funcdef inside the namespace. There is also a function with the same name in the global namespace. The first time the module compiles without problems.
Then the new instance of module is compiled again on the same engine. The fall is happening at this moment:
as_buider.cpp, 1677
if( funcDefs[n]->name == name &&
module->m_funcDefs[funcDefs[n]->idx]->nameSpace == ns )
First, a funcdef is added in this place - as_builder.cpp, 1934.
But then in this place - as_builder.cpp, 2004
module->ReplaceFuncDef(fdt, fdt2);
it is replaced by another. And instead of the ID in the list of module funcdefs, the function ID is written there.
And then at line 1677 - since the name of the function and the funcdef are the same, when trying to check the namespace name, the funcDefs[n]->idx
wrong and OOB crash programm.