Permalink
Browse files

fix Issue 9304 - Unary minus operator doesn't work correctly with SIM…

…D types.
  • Loading branch information...
1 parent b1aac2d commit ecb14d78cdd04813382676e9ff10e3c43c5bdb63 @WalterBright WalterBright committed Jan 15, 2013
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/backend/cgelem.c
View
@@ -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);
}

0 comments on commit ecb14d7

Please sign in to comment.