Sign in to follow this  

Using access masks on member functions

Recommended Posts

I'm trying to use access masks to expose a member function to only 1 type of module like this:

asIScriptEngine* pEngine = ...;

asDWORD uiAccessMask = pEngine->SetDefaultAccessMask( 2 );

pEngine->RegisterObjectMethod( "Entity", "int Get()", asMETHOD( Entity, Get ), asCALL_THISCALL );

pEngine->SetDefaultAccessMask( uiAccessMask );

The module being compiled has an access mask of 5, which is 1 (global access) and 4 (stuff specific to this module) , while the method uses an access mask of 2 (stuff specific to another module)


Yet, when i try to use the method in a module with an access mask of 5, it still compiles just fine.


This script compiles without errors:

void test(Entity@ ent)

According to this, i can use access masks on individual methods.

I dug through the compiler source code, and i didn't see any code that checks the access mask. Am i doing something wrong, or is this a bug?


Example program that shows the bug is included.

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