mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
fix #21153 - [REG 2.111.0] Infinite loop in isAliasThisTuple
Partially reverts the regressing change in 08901365d4
. The "fixed"
refactoring should be applied to master/development branch.
This commit is contained in:
parent
ce16000c48
commit
51816cd01d
1 changed files with 16 additions and 16 deletions
|
@ -641,23 +641,23 @@ TupleDeclaration isAliasThisTuple(Expression e)
|
||||||
Type t = e.type.toBasetype();
|
Type t = e.type.toBasetype();
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
Dsymbol s = t.toDsymbol(null);
|
if (Dsymbol s = t.toDsymbol(null))
|
||||||
if (!s)
|
|
||||||
return null;
|
|
||||||
auto ad = s.isAggregateDeclaration();
|
|
||||||
if (!ad)
|
|
||||||
return null;
|
|
||||||
s = ad.aliasthis ? ad.aliasthis.sym : null;
|
|
||||||
if (s && s.isVarDeclaration())
|
|
||||||
{
|
{
|
||||||
TupleDeclaration td = s.isVarDeclaration().toAlias().isTupleDeclaration();
|
if (auto ad = s.isAggregateDeclaration())
|
||||||
if (td && td.isexp)
|
{
|
||||||
return td;
|
s = ad.aliasthis ? ad.aliasthis.sym : null;
|
||||||
}
|
if (s && s.isVarDeclaration())
|
||||||
if (Type att = t.aliasthisOf())
|
{
|
||||||
{
|
TupleDeclaration td = s.isVarDeclaration().toAlias().isTupleDeclaration();
|
||||||
t = att;
|
if (td && td.isexp)
|
||||||
continue;
|
return td;
|
||||||
|
}
|
||||||
|
if (Type att = t.aliasthisOf())
|
||||||
|
{
|
||||||
|
t = att;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue