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

Run with bound checking #29

Merged
merged 1 commit into from
Feb 23, 2024
Merged

Conversation

pmarguinaud
Copy link
Collaborator

Because of this small piece of code (generated from field_RANKSUFF_data_module.fypp) :

  ITHIS_STRIDE = LOC (PTR (LB(1)+1, LB(2), LB(3), LB(4))) - LOC (PTR (LB(1), LB(2), LB(3), LB(4)))
  IF (AFTER < 1) THEN 
    ISIZE = 1
    IF (SIZE(PTR, 1) /= 1 .AND. IPREVIOUS_STRIDE * ISIZE /= ITHIS_STRIDE) THEN 

Field API could not run with bound checking enabled : the access to PTR in the LOC intrinsic could go out of bounds when SIZE (PTR, 1) == 1.

This PR solves the issue.

@pmarguinaud pmarguinaud requested a review from awnawab February 23, 2024 10:42
Copy link
Collaborator

@awnawab awnawab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well spotted and cleanly fixed! Thanks for this, G2G 👍

@pmarguinaud pmarguinaud merged commit db50169 into ecmwf-ifs:main Feb 23, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants