Skip to content

Commit

Permalink
Merge pull request #14074 from ibuclaw/issue23089
Browse files Browse the repository at this point in the history
fix Issue 23089 - Linkage-related ICE regression in v2.100.0-rc.1
  • Loading branch information
kinke authored May 5, 2022
2 parents 3a66d2f + c23195d commit de56f38
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/dmd/tocsym.d
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ Symbol *toSymbol(Dsymbol s)
}

mangle_t m = 0;
final switch (vd.linkage)
const linkage = vd.linkage == LINK.system ? target.systemLinkage() : vd.linkage;
final switch (linkage)
{
case LINK.windows:
m = target.is64bit ? mTYman_c : mTYman_std;
Expand Down
3 changes: 2 additions & 1 deletion src/dmd/toobj.d
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,8 @@ void toObjFile(Dsymbol ds, bool multiobj)
*/
static mangle_t mangle(const VarDeclaration vd)
{
final switch (vd.linkage)
const linkage = vd.linkage == LINK.system ? target.systemLinkage() : vd.linkage;
final switch (linkage)
{
case LINK.windows:
return target.is64bit ? mTYman_c : mTYman_std;
Expand Down
7 changes: 7 additions & 0 deletions test/compilable/test23089.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://issues.dlang.org/show_bug.cgi?id=23089
extern(System) int i23089;

extern(System):

alias F23089 = void function(int);
F23089 f23089;

0 comments on commit de56f38

Please sign in to comment.