Jump to content
  • Advertisement
Sign in to follow this  
virious

BUG: asCContext::GetLineNumber(asUINT stackLevel, int *column, const char **sectionName)

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

I think I've found a bug. The method:

int asCContext::GetLineNumber(asUINT stackLevel, int *column, const char **sectionName)
returns wrong line number when it comes to the object constructor. Take a look at the screenshot of my AS IDE which I'm currently developing:

BugReport_WrongLineNumber.png


As you can see on my callstack, it says that the constructor of the class named "MyClass" is in line 0, but it should tell that it's in the line 43.

The method:
int asCScriptFunction::GetLineNumber(int programPosition)
which is called from asCContext::GetLineNumber is returning 0, because lineNumbers.GetLength() equals 0 when it comes to the constructor.

I'm using AngelScript 2.20:

#define ANGELSCRIPT_VERSION 22000
#define ANGELSCRIPT_VERSION_STRING "2.20.0 WIP"

Share this post


Link to post
Share on other sites
Advertisement

As you can see on my callstack, it says that the constructor of the class named "MyClass" is in line 0, but it should tell that it's in the line 43.




My guess would be it refers to a constructor version created on the fly by the compiler.

Share this post


Link to post
Share on other sites
Actually, the function MyClass @MyClass(int), is a factory stub. It is responsible for allocating the memory for the script class, and then call the class' constructor MyClass::Myclass(int) to initialize it. It is an automatically generated piece of code, so it doesn't have a line number (which is why you're getting the line 0).

Share this post


Link to post
Share on other sites
Thanks for the answer :). So I will just modify my callstack and I will try to filter out entries with line number = 0 on the object constructors (I must think of method how to know when the callstack entry with the line number equal 0 occured on constructor).

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!