Sign in to follow this  
loboWu

bytecode save/restore cause exception!

Recommended Posts

I try to upgrade 2.17.0 from 2.16.0. but I found a bug about asIScriptArray bytecode save/restore. try this simple code in C++ asIScriptArray* GlobalCharArray = (asIScriptArray*) engine->CreateScriptObject(engine->GetTypeIdByDecl("uint8[]")); GlobalCharArray->Resize(256); r = engine->RegisterGlobalProperty("uint8[] GlobalCharArray", GlobalCharArray); assert( r >= 0 ); and in script side void main() { GlobalCharArray[1] = 10; print(string(GlobalCharArray[1])); } it could be bulided and run with right result. But when I save the bytecode to file and restore it, it will raise exception in as_restore.cpp It seems that, any registered functions with asIScriptArray would raise the same exception. ex: r = engine->RegisterGlobalFunction("string@ ARRAYTOHEX(uint8[] &in)", asFUNCTION(ArrayToHexStr), asCALL_CDECL); assert( r >= 0 ); asString* ArrayToHexStr(asIScriptArray *arr) { ...... } Thanks a lot. lobo

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this