Skip to content

Commit 98c4543

Browse files
authored
Merge pull request #4941 from kinke/cherry_picks
Cherry-pick 2 upstream fixes for 2.111 regressions
2 parents 003673b + 289d365 commit 98c4543

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

dmd/expressionsem.d

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5672,7 +5672,6 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
56725672
s = "__funcliteral";
56735673

56745674
DsymbolTable symtab;
5675-
string parentMangle;
56765675
if (FuncDeclaration func = sc.parent.isFuncDeclaration())
56775676
{
56785677
if (func.localsymtab is null)
@@ -5682,7 +5681,6 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
56825681
func.localsymtab = new DsymbolTable();
56835682
}
56845683
symtab = func.localsymtab;
5685-
parentMangle = cast(string) mangleExact(func).toDString();
56865684
}
56875685
else
56885686
{
@@ -5695,13 +5693,9 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
56955693
sds.symtab = new DsymbolTable();
56965694
}
56975695
symtab = sds.symtab;
5698-
5699-
OutBuffer buf;
5700-
mangleToBuffer(sds, buf);
5701-
parentMangle = buf.extractSlice();
57025696
}
57035697
assert(symtab);
5704-
Identifier id = Identifier.generateIdWithLoc(s, exp.loc, parentMangle);
5698+
Identifier id = Identifier.generateIdWithLoc(s, exp.loc, cast(const void*) sc.parent);
57055699
exp.fd.ident = id;
57065700
if (exp.td)
57075701
exp.td.ident = id;

dmd/identifier.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ nothrow:
221221
* Identifier (inside Identifier.idPool) with deterministic name based
222222
* on the source location.
223223
*/
224-
extern (D) static Identifier generateIdWithLoc(string prefix, Loc loc, string parent = null)
224+
extern (D) static Identifier generateIdWithLoc(string prefix, Loc loc, const void* parent = null)
225225
{
226226
// generate `<prefix>_L<line>_C<col>`
227227
auto sl = SourceLoc(loc);
@@ -248,7 +248,7 @@ nothrow:
248248
* directly, but that would unnecessary lengthen symbols names. See issue:
249249
* https://issues.dlang.org/show_bug.cgi?id=23722
250250
*/
251-
static struct Key { string locKey; string prefix; string parent; }
251+
static struct Key { string locKey; string prefix; const(void)* parent; }
252252
__gshared uint[Key] counters;
253253

254254
const locKey = cast(string) (sl.filename ~ idBuf[]);

dmd/typesem.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7330,7 +7330,7 @@ Type substWildTo(Type type, uint mod)
73307330
t = t.addMod(MODFlags.shared_);
73317331

73327332
//printf("-Type.substWildTo t = %s\n", t.toChars());
7333-
return t;
7333+
return t.merge();
73347334
}
73357335

73367336
if (!tf.iswild && !(tf.mod & MODFlags.wild))

0 commit comments

Comments
 (0)