A '?:' expression, when occurring as a standalone statement, gets expanded into an 'if' statement, even if there are no side-effects in either branch. This patch fixes that by simply eliminating the statement altogether, or keeping the condition's side-effects if there were any.

For example,
  x ? 0 : 1;
had been transformed into
  if (x) { }
but, with this patch, is just eliminated.

Also,
  x++ ? 0 : 1;
had been transformed into
  tmp = x;
  x ++;
  if (tmp) { }
and now simply becomes 'x ++;'.

Elnatan

Attachment: empty_question.c
Description: Binary data

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to