Crash at building new module after existing one

Started by
3 comments, last by Alexander Orefkov 1 year, 5 months ago

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.

Advertisement

Thanks for the bug report and the precise analysis.

I'll investigate and fix this as soon as possible.

Regards,

Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I've fixed this in revision 2811.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thank you very much!

This topic is closed to new replies.

Advertisement