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

Started by
2 comments, last by virious 13 years, 1 month ago
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"
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.
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).

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

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).

This topic is closed to new replies.

Advertisement