🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Bug in AngelScript 2.8.1 compiler

Started by
0 comments, last by WitchLord 16 years, 11 months ago
There seems to be a bug in AngelScript 2.8.1 compiler that involves processing the return statement. If you have a void returning function and attempt to return the result of a call to that function, the compiler dies. Example:

int main(int, char **) {
  asIScriptEngine * engine = asCreateScriptEngine(ANGELSCRIPT_VERSION);
  std::string script =
    "void noop() {}\n"
    "int fuzzy() {\n"
    "  return noop();\n"
    "}\n";
  engine->AddScriptSection("", "", script.c_str(), script.length());
  engine->Build(""); // crash in this call
  
  return 0;
}
In debug mode it'll trigger an assertion in as_compiler.cpp on line 6643. In release mode it'll cause an access violation in as_module.cpp on line 807. This is with the default options (no changes to the config header). I found this out when I accidentally registered a function with an "int f()" signature as "void f()".
Advertisement
Thanks SiCrane,

I'll have this fixed for 2.9.0.

Regards,
Andreas

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