I run my script which use a lot of strings and after several runs my app crashing with this:
source/as_scriptengine.cpp:5893: int asCScriptEngine::AddConstantString(const char*, size_t): Assertion `stringConstants.GetLength() <= 65536' failed.
It seems like buffer overflow.
I don't need strings i pass after script will be executed but library still retain them. How i should clean up string cache to make it work?
Version of library is 2.30.2. I run script like this:
std::string section = "usercode";
asIScriptFunction *pfunc = nullptr;
if(module->CompileFunction(section.c_str(),code.c_str(),0,0,&pfunc) < 0) {
return 0;
}
asIScriptContext *context = requestContext(pfunc);
context->Execute();
context->Unprepare();
pfunc->Release();
.
Example of my script
array<string> huge_array = {
"1",
"2",
"3",
...
// lots of strings here
...
"9999",
"10000"
};
foo(huge_array);