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

Assertion failure if same module included in compilation twice #1813

Closed
bbannier opened this issue Jul 30, 2024 · 1 comment · Fixed by #1814
Closed

Assertion failure if same module included in compilation twice #1813

bbannier opened this issue Jul 30, 2024 · 1 comment · Fixed by #1814
Assignees
Labels
Bug Something isn't working Compiler Regression

Comments

@bbannier
Copy link
Member

If the same module is added to the compilation twice an assertion failure is triggered (in debug builds) or compilation aborts with a segfault (in release builds).

# foo.spicy
module foo;
$ spicyc -dj foo.spicy foo.spicy
Assertion failed: (_modules_by_uid.find(module->uid()) == _modules_by_uid.end()), function _addModuleToAST, file ast-context.cc, line 349.
[1]    98243 abort spicyc -dj foo.spicy foo.spicy

This regressed with #1462.

@bbannier bbannier added Bug Something isn't working Regression Compiler labels Jul 30, 2024
@bbannier bbannier changed the title Assertion failure in same module included in compilation twice Assertion failure if same module included in compilation twice Jul 30, 2024
@bbannier bbannier self-assigned this Jul 30, 2024
bbannier added a commit that referenced this issue Jul 30, 2024
We already computed a `unique` `ID` value for each module to allow
declaring the same `ID` name multiple times; we however did not
consistently use that value in the implementation of `module::UID`
equality and hash operators which is addressed by this patch.

Closes #1813.
bbannier added a commit that referenced this issue Jul 30, 2024
We already computed a `unique` `ID` value for each module to allow
declaring the same `ID` name multiple times; we however did not
consistently use that value in the implementation of `module::UID`
equality and hash operators which is addressed by this patch.

Closes #1813.
@bbannier
Copy link
Member Author

Also backported to releases/1.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Compiler Regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant