• Advertisement
Sign in to follow this  

Context GetLineNumber crash

This topic is 1923 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

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.

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


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

  • Advertisement