Bug 16348 – [REG 2.070.2] ICE with package visibility

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2016-08-02T08:17:00Z
Last change time
2016-11-04T09:04:56Z
Keywords
ice, ice-on-valid-code, pull
Assigned to
code
Creator
lodovico
See also
https://issues.dlang.org/show_bug.cgi?id=16460

Comments

Comment #0 by lodovico — 2016-08-02T08:17:46Z
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(); } } ==============
Comment #1 by lodovico — 2016-08-02T08:42:33Z
Raising as a regression, as the test case compiles fine with 2.070.2 but segfaults with 2.071.1
Comment #2 by code — 2016-08-02T12:14:42Z
Seems like the anonymous scope created in the else branch after the import doesn't contain a parent link to the current module.
Comment #3 by code — 2016-08-08T10:25:32Z
Comment #4 by github-bugzilla — 2016-08-08T20:11:53Z
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
Comment #5 by github-bugzilla — 2016-09-19T23:46:51Z
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
Comment #6 by github-bugzilla — 2016-11-04T09:04:56Z
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