Segmentation fault in function hasPackageAccess(Module*, DSymbol*). Test case: file source/mypackage/bar.d ============== module mypackage.bar; package bool bar() { return false; } ============== file source/mypackage/foo.d ============== module mypackage.foo; void foo() { // removing the if-else also removes the segfault if (false) {} else { // changing this to a selective import removes the segfault import mypackage.bar; auto b = bar(); } } ==============
Raising as a regression, as the test case compiles fine with 2.070.2 but segfaults with 2.071.1
Seems like the anonymous scope created in the else branch after the import doesn't contain a parent link to the current module.
https://github.com/dlang/dmd/pull/6014
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/93c3dcf26f5c5ae612ccce044012d2b297fe46bf fix Issue 16348 - ICE with package visibility - fix scopesym parent chain when using semanticScope - fixes getAccessModule for scope symbols in do bodies, try bodies, and else branches https://github.com/dlang/dmd/commit/d400dffec4f782ac9cc27f7e682a726042949f9e Merge pull request #6014 from MartinNowak/fix16348 fix Issue 16348 - ICE with package visibility
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/93c3dcf26f5c5ae612ccce044012d2b297fe46bf fix Issue 16348 - ICE with package visibility https://github.com/dlang/dmd/commit/d400dffec4f782ac9cc27f7e682a726042949f9e Merge pull request #6014 from MartinNowak/fix16348
Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/93c3dcf26f5c5ae612ccce044012d2b297fe46bf fix Issue 16348 - ICE with package visibility https://github.com/dlang/dmd/commit/d400dffec4f782ac9cc27f7e682a726042949f9e Merge pull request #6014 from MartinNowak/fix16348