Advertisement

Load byte code and execute failed

Started by June 30, 2010 08:07 AM
3 comments, last by hoboaki 14 years, 5 months ago
Hi.
My application succeeded in loading byte code at last!
But when my application execute loaded byte code, my application crashed.

Revision
r613

Compiler
MSVC8

script code
interface IObj {};class Hoge : IObj {};void main(){    Hoge h;    IObj@ objHandle = h;    Hoge@ hogeHandle = cast< Hoge@ >( objHandle );};


My application stopped at as_context.cpp L2866.
Please investigate.
I've confirmed the bug. It seems the CAST instruction isn't properly serialized. I'll have this fixed right away.

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

Advertisement
As I suspected the problem was with the saving and loading of the CAST instruction. Fortunately the fix is easy.

In as_restore.cpp, function WriteByteCode, line 1394, change the condition to do the same for asBC_Cast as is currently done for asBC_TYPEID, i.e.

	else if( c == asBC_TYPEID || // DW_ARG                 c == asBC_Cast )    // DW_ARG


Do the same in function TranslateFunction, line 2000.

I'll have this fix checked in tonight.

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

Fixed in revision 614. Thanks.

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

I confirmed that this bug was fixed at r614.
And my application succeeded in loading and executing byte code.
Thank you for a lot of bug fixes!

This topic is closed to new replies.

Advertisement