D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16855 - Global void[0] causes OPTLINK Error when passed as ref Parameter
Summary: Global void[0] causes OPTLINK Error when passed as ref Parameter
Status: RESOLVED DUPLICATE of issue 16129
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P1 normal
Assignee: No Owner
URL:
Keywords: Optlink
Depends on:
Blocks:
 
Reported: 2016-11-30 01:42 UTC by Bolpat
Modified: 2017-10-25 03:32 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 Bolpat 2016-11-30 01:42:58 UTC
The following lusting generates a OPTLINK error.

    void[0] Dummy1;
    void f(ref void[0] x) { }
    void main()
    {
        f(Dummy1);
        
        static void[0] Dummy2;
        f(Dummy2);
    }

It does not occur when a local void[0] is passed to f or the parameter is not ref.
For Dummy1 it does not matter wether it is static or not.
Comment 1 Walter Bright 2017-01-09 01:23:57 UTC
This produces the error:

OPTLINK (R) for Win32  Release 8.00.17
Copyright (C) Digital Mars 1989-2013  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
bug4.obj(bug4)  Offset 0026DH Record Type 009D
 Error 16: Index Range
Error: linker exited with status 1

which looks like a corrupt object file being passed to it.
Comment 2 Walter Bright 2017-10-25 03:32:51 UTC

*** This issue has been marked as a duplicate of issue 16129 ***