Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


- - - - -

Losing some function pointers after bytecode reload


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 thd.MM   Members   -  Reputation: 208

Like
0Likes
Like

Posted 17 January 2013 - 03:50 AM

I don't know where to start with this bug, so I'll just describe what happens.

I'm using the latest AS but it was like this a couple versions earlier too.

 

After I load byte code I get all sorts of errors.

Mainly I lose function pointers from the cache. I cache functions after loading like this:

 

cachedFuncs.func_onRender_CRules = mModule->GetFunctionByDecl( "void onRender( CRules@ this )" ); 

 

Now some functions lose the pointers and its just garbage. Not immediately but after some time before running the script.

But this is not the issue, its just an effect, cause if I dont use the cache there are some other random errors and crashes inside AS code.

 

I'm not 100% sure but I think the files I see breaking are the ones using an enum. It might be an AS bug not handling these enums properly:

 

this is the enum that is used in those files:

 

 

namespace Hitters {
shared enum hits{
hitter_nothing = 0,
 
//env
hitter_fall,
hitter_drown,
hitter_burn,
hitter_crush,
hitter_flying,
 
//common actor
hitter_stomp,
hitter_suicide,
 
//builders
hitter_hammer, //mason
hitter_saw, //carpenter
hitter_pick, //peasant
 
//arrows and similar projectiles
hitter_arrow,
hitter_ballista,
 
//cata
hitter_cata_stones,
 
//knight
hitter_sword,
hitter_shield,
hitter_bomb,
 
//siege
hitter_ram,
 
//traps
hitter_spikes,
 
//barbarian
hitter_muscles
};
}
 
 
its "shared" now but without shared it breaks too.


Sponsor:

#2 Andreas Jonsson   Moderators   -  Reputation: 3452

Like
0Likes
Like

Posted 19 January 2013 - 01:48 PM

It sounds like it might be a bug in AngelScript. Unfortunately I will need more information in order to reproduce the problem so I can identify and fix the bug.

 

Is it possible for you to write a smaller script that reproduces the problem? 

 

Can you identify what function in the script that causes the functions to become invalid? 


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

#3 Andreas Jonsson   Moderators   -  Reputation: 3452

Like
0Likes
Like

Posted 12 February 2013 - 12:59 PM

I just made a fix that I think may be related to this problem that you reported. You can find the fix in revision 1555 + 1556.

 

I found this problem after discussing the problem that TheAtom reported here: http://www.gamedev.net/topic/638529-wrong-function-called-on-bytecode-restoration/

 

It would be great if you could try it out to see if this corrected your problem too.

 

[edit] additional fixes related to this problem


Edited by Andreas Jonsson, 13 February 2013 - 03:05 PM.

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS