Jump to content

  • Log In with Google      Sign In   
  • Create Account


- - - - -

Context GetLineNumber crash


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 saejox   Members   -  Reputation: 714

Like
0Likes
Like

Posted 16 October 2012 - 01:07 PM

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.

Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3291

Like
0Likes
Like

Posted 16 October 2012 - 01:42 PM

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

#3 Andreas Jonsson   Moderators   -  Reputation: 3291

Like
2Likes
Like

Posted 16 October 2012 - 07:52 PM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS