Sign in to follow this  
Lioirc

gvar-index bug

Recommended Posts

Hi in as_builder as_builder::RegisterGlobalVar() { ........ it should be gvar->index = mod->AllocGlobalMem(.....) ; instead of: gvar->index = mod->moduleID | mod->AllocGlobalMem(.....) ; } because there is no global mem, but a mem per module, so why store the module id in the index? this causes a bug when requesting the variable pointer (with multiple modules, i.e modID == 0x0001, then the first mod->gvar index == 0x00010001) because its returned like this: *pointer = (void*) (mod->globalMemAddressOf() + mod->globals[id]->index); if its needed to have the module id in the index of the gvar (but why?), then in scriptengine::GetGlobalVarPtr it should be: *pointer = (void*) (mod->globalMemAddressOf() + (mod->globals[id]->index & 0xFFFF)); but in this case, (mod->globals[id]->index) & 0xFFFF) == id, so it can be: *pointer = (void*) (mod->globalMemAddressOf() + id); Remeber that this is for 1.8.2b1 Best Regards, Lioric

Share this post


Link to post
Share on other sites
Yeah, the modules that were implemented in version 1.8.0 unfortunately introduced a lot of bugs like this one. However, I believe most of those bugs have been eliminated already. Especially this one was removed a long time ago.

Thanks anyway.

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