Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong definition of MPS_PROT_INNER #285

Open
gerd-moellmann opened this issue Mar 21, 2024 · 0 comments
Open

Wrong definition of MPS_PROT_INNER #285

gerd-moellmann opened this issue Mar 21, 2024 · 0 comments

Comments

@gerd-moellmann
Copy link

I'm creating a root

mps_root_t root;
mps_res_t res = mps_root_create_area (&root, arena, mps_rank_exact (),
  MPS_RM_PROT + MPS_RM_PROT_INNER, 
  start, end, scan_staticvec, NULL);

and get an assertion failure

root.c:89: MPS ASSERTION FAILED: (mode & RootModePROTECTABLE_INNER) == 0 || (mode & RootModePROTECTABLE)

Looking at the sources, I see that mpmtypes.h has

#define RootModePROTECTABLE_INNER ((RootMode)1<<2)

while mps.h has

#define MPS_RM_PROT       (((mps_rm_t)1<<1))
#define MPS_RM_PROT_INNER (((mps_rm_t)1<<1))

MPS_RM_PROT_INNER + MPS_RN_PROT is 4 which is, in the check, INNER without specifying PROT.

So I think the definition of MPS_PROT_INNER should have been 1 << 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant