Advertisement

Context GetLineNumber crash

Started by October 16, 2012 07:07 PM
1 comment, last by WitchLord 12 years, 1 month ago
Hi,


void LineCallback(asIScriptContext* ctx)
{
unsigned int ssize = ctx->GetCallstackSize();
for(unsigned int i = 0; i < ssize; ++i)
{
ctx->GetLineNumber(i, 0, 0); // crash i = 1, ssize = 4
}
}
ctx->SetLineCallback(asFUNCTION(LineCallback), 0, asCALL_CDECL);


script is

class Child
{
};

class Object
{
Child c;
};

void main()
{
Object f;
}


only occurs if there are nested constructors to step in.

crash stack:
-> AngelScriptTest.exe!asCArray<unsigned long>::AddressOf() Line 96 + 0x3 bytes C++
-> AngelScriptTest.exe!asCContext::GetLineNumber(unsigned int stackLevel=1, int * column=0x00000000, const char * * sectionName=0x00000000) Line 1380 + 0xe bytes C++


Thanks.
Thanks. I'll look into this.

When a nested call is made, a dummy entry representing the system call is placed on the callstack. The crash is probably because the library attempts to determine the line number for this function, where it of course should simply return 0.

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

Advertisement
I've fixed this in revision 1438. Thanks.

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

This topic is closed to new replies.

Advertisement