Advertisement

huge problems with precompilde byte code

Started by October 17, 2012 07:07 AM
18 comments, last by _Engine_ 12 years, 1 month ago
Hi!

So there are no more halting on assert. But precompiled bytecode still do not work properly. Looks like problem lies in imported functions. Somehow some function do not imported successfully from another module. This functions use shared classes as input and return value. In simple script i cannot reproduce problem. We have no choise expect drop off imported functions and use function pointers instead.
Hm, looks like function pointers is something strange. Imported functions are planned to deprecate in Angel Script 3.0 but i can't understend how modules can communicate using function pointers. So imported feature do not work and there are no another solution. We are stucked (((
Advertisement
Hi!

So problem is - byte code can't load and it return -1 on loading. Error comes when loading shared constructors section.
This link http://www63.zippyshare.com/v/43593543/file.html leads to archive with modifaied sample "include" from angel code also archive contain scripts with leads to bug when loading shared classes.
Thanks. I'll investigate the problem and have it fixed as soon as possible.

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've reduced the problem to this script:


shared enum ResourceType {}
shared class Resource
{
void getType(ResourceType) {}
}


There is definitely something wrong with the combination of the shared enum and shared class.

I'll update when I have the fix.

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've fixed the bug in revision 1444.

The problem was that the shared enums were not treated as shared when loading the bytecode, so each module got its own unique enum. This caused the other shared entities (classes, functions, etc) that used that enum to not match the original declaration, which is why the loading failed.

Thanks for the help in producing the code that allowed me to debug this.

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
Big big thanks :)

this problem was gone but, but i found another bug.
This link to archive with problem code - http://www36.zippyshare.com/v/57990345/file.html
in sample fisrt loaded testbed.as and second goes second.as. BuildingDesc are included in testbed.as but not in second.as but comiler successfully find SBuldDesc when compiling second.as. When we try load bytecode for second.as complier can't find SBuldDesc and that is right. So problem is compiler find description of type that declared in another module but this must be are error as it is when loading bytecode or this should work and for byte code but i think is wrong becasu this no logical.
You're right. The compilation of second.as should fail if it doesn't declare the shared SBuildingDesc. I'll look into this when I get home 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

The problem was with shared classes. When a shared class was found during compilation and it had already been compiled in a previous the members were not compiled again so it wasn't detected that they were using some types that were otherwise not declared in the script. When the script was then saved, the full declaration of the shared class was saved including the reference to the other types.

I've fixed this in revision 1445. The missing declaration will now be properly detected during compilation of the script.

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

Thanks :)

Looks like now all work fine :)

This topic is closed to new replies.

Advertisement