Skip to content

Commit

Permalink
fix Issue 9304 - Unary minus operator doesn't work correctly with SIM…
Browse files Browse the repository at this point in the history
…D types.
  • Loading branch information
WalterBright committed Jan 15, 2013
1 parent b1aac2d commit ecb14d7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/backend/cgelem.c
Expand Up @@ -1067,12 +1067,14 @@ STATIC elem * elmin(elem *e)

/* Replace (0 - e2) with (-e2) */
if (cnst(e1) && !boolres(e1) &&
!(tycomplex(tym) && !tycomplex(e1->Ety) && !tycomplex(e2->Ety))
!(tycomplex(tym) && !tycomplex(e1->Ety) && !tycomplex(e2->Ety)) &&
!tyvector(e1->Ety)
)
{ el_free(e1);
{
e->E1 = e2;
e->E2 = NULL;
e->Eoper = OPneg;
el_free(e1);
return optelem(e,TRUE);
}

Expand Down

0 comments on commit ecb14d7

Please sign in to comment.