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()".
🎉 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
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:
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement