Sign in to follow this  

Crash on bytecode loading

This topic is 2107 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Tested on rev 1176. Getting a null pointer access when loading bytecode with two modules, both containing the following:
[code]
shared class T
{
void f() { }
};

shared class T2 : T
{
};

class T3 : T
{
void f() { T::f(); }
};
[/code]

Stack:
[code]
asCScriptFunction::AddReferences() Line 661 + 0x23 bytes C++
asCReader::Read() Line 366 C++
asCModule::LoadByteCode(asIBinaryStream * in) Line 1470 + 0xb bytes C++
[/code]

Where:
[code]
case asBC_CALLINTF:
{
int func = asBC_INTARG(&byteCode[n]);
engine->scriptFunctions[func]->AddRef(); // func is 0 here and scriptFunctions[func] is NULL
}
[/code]

Note: the crash goes away if T2 is removed or made nonshared.

Share this post


Link to post
Share on other sites
Sign in to follow this