Skip to content

Conversation

@copy
Copy link
Contributor

@copy copy commented May 24, 2023

Fixes #12257.

As suspected in #12257 (comment), module aliases also trigger the problem. I'm not too familiar with the module representation, so it would be good if an flambda dev could have a closer look to see if any other constructs could trigger the problem.

@lthls
Copy link
Contributor

lthls commented May 24, 2023

Do you think you could rewrite this part of the code to use Includemod.is_runtime_component instead ? I believe that it's computing exactly what we need here, and the fact that its implementation is slightly different from your current proposal makes me nervous.

@copy
Copy link
Contributor Author

copy commented May 24, 2023

@lthls Good idea, done.

Copy link
Contributor

@lthls lthls left a comment

Choose a reason for hiding this comment

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

I'm fine with the current version. We could add an extra sanity check that the number of runtime components in the signature (List.length exported) is equal to the size of the module block if we feel extra cautious, but if it's not we're likely going to find out immediately in a slightly less friendly way anyway.

@gasche gasche merged commit fc9b93b into ocaml:trunk May 24, 2023
@gasche
Copy link
Member

gasche commented May 24, 2023

Merged, thanks!

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.

ocamlnat: Invalid_argument("index out of bounds") when using external with flambda enabled

3 participants