D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16460 - [REG2.071] ICE for package visibility check in function literal
Summary: [REG2.071] ICE for package visibility check in function literal
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 regression
Assignee: Martin Nowak
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2016-09-02 01:37 UTC by jiki
Modified: 2016-11-04 09:05 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jiki 2016-09-02 01:37:57 UTC
Internal AV with Windows 7 64-bit and Win10.
This seems to be a 2.071 regression about package access.
2.071.2 beta3 doesn't fix it.

Reduced code is here.

COMMAND:
dmd test.d imp.d

RESULT:
object.Error@(0): Access Violation
----------------
0x00402502
0x0108B660
0x0108C100

CODE:
*imp.d
module pkg.imp;
package void pkgFunc() { } // package access needs

*test.d
module pkg.test;
void main()
{
    //import pkg.imp; // this works
    enum d = (){
        import pkg.imp; // this crashes
        pkgFunc();
    };
}
Comment 1 jiki 2016-09-12 23:58:41 UTC
This looks like Issue 16348, but is NOT.
2.071.2 beta4 doesn't fix.
Comment 2 Martin Nowak 2016-09-13 05:33:10 UTC
(In reply to jiki from comment #1)
> This looks like Issue 16348, but is NOT.
> 2.071.2 beta4 doesn't fix.

It's another instance of Issue 16384, just a different place where the scope gets created without scope symbol.

https://github.com/dlang/dmd/pull/6128
Comment 3 github-bugzilla 2016-09-13 11:11:01 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/0c9374cec813f8b29483bebd5a659be55958c299
fix Issue 16460 - ICE for package visibility check in function literal

- fixed by skipping symbol-less scopes when establishing scope for
  FuncDeclaration
- symbol-less scopes like Scope.startCTFE and FuncExp scopes don't
  require a symbol table (and thus don't create a scopesym)

https://github.com/dlang/dmd/commit/8679fd9b9b5f401f834047cd0c14ebd338566cfd
Merge pull request #6128 from MartinNowak/fix16460

fix Issue 16460 - ICE for package visibility check in function literal
Comment 4 github-bugzilla 2016-09-27 04:01:21 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/0c9374cec813f8b29483bebd5a659be55958c299
fix Issue 16460 - ICE for package visibility check in function literal

https://github.com/dlang/dmd/commit/8679fd9b9b5f401f834047cd0c14ebd338566cfd
Merge pull request #6128 from MartinNowak/fix16460
Comment 5 github-bugzilla 2016-11-04 09:05:03 UTC
Commits pushed to newCTFE at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/0c9374cec813f8b29483bebd5a659be55958c299
fix Issue 16460 - ICE for package visibility check in function literal

https://github.com/dlang/dmd/commit/8679fd9b9b5f401f834047cd0c14ebd338566cfd
Merge pull request #6128 from MartinNowak/fix16460