mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Remove optimizer syntax copies where they weren't proven to be necessary.
Copying without calling semantic() leads to issues for more complicated expressions.
This commit is contained in:
@@ -365,7 +365,6 @@ Expression *CastExp::optimize(int result)
|
||||
if (e1->op == TOKnull &&
|
||||
(type->ty == Tpointer || type->ty == Tclass))
|
||||
{
|
||||
e1 = e1->syntaxCopy();
|
||||
e1->type = type;
|
||||
return e1;
|
||||
}
|
||||
@@ -381,7 +380,6 @@ Expression *CastExp::optimize(int result)
|
||||
cdto = type->isClassHandle();
|
||||
if (cdto->isBaseOf(cdfrom, &offset) && offset == 0)
|
||||
{
|
||||
e1 = e1->syntaxCopy();
|
||||
e1->type = type;
|
||||
return e1;
|
||||
}
|
||||
@@ -396,7 +394,6 @@ Expression *CastExp::optimize(int result)
|
||||
if (type->size() == e1->type->size() &&
|
||||
type->toBasetype()->ty != Tsarray)
|
||||
{
|
||||
e1 = e1->syntaxCopy();
|
||||
e1->type = type;
|
||||
return e1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user