On 03/09/2015 10:34 AM, Jakub Jelinek wrote:
On Fri, Feb 27, 2015 at 05:29:47PM -0500, Jason Merrill wrote:
On 02/19/2015 07:03 PM, Jakub Jelinek wrote:
+         /* Avoid warning for !!b == y where b is boolean.  */
+         && (!DECL_P (current.lhs)
+             || TREE_TYPE (current.lhs) == NULL_TREE
+             || TREE_CODE (TREE_TYPE (current.lhs)) != BOOLEAN_TYPE))

There's something wrong here.  If the type is null, trying to check its
TREE_CODE will SEGV.

If the type is NULL, then it will just call warn_logical_not_parentheses
and won't check TREE_CODE.  Only when it is non-NULL, it will check
TREE_CODE and if it is not BOOLEAN_TYPE, will call
warn_logical_not_parentheses.

You're right, of course. I guess I was reading the || as an &&. The patch is OK.

Jason


Reply via email to