Commit 315a02da by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

* tree.c (initializer_zerop): Handle STRING_CST.

From-SVN: r159103
parent 3734d960
2010-05-06 Maxim Kuvyrkov <maxim@codesourcery.com>
* tree.c (initializer_zerop): Handle STRING_CST.
2010-05-06 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 40989
......
......@@ -9414,6 +9414,19 @@ initializer_zerop (const_tree init)
return true;
}
case STRING_CST:
{
int i;
/* We need to loop through all elements to handle cases like
"\0" and "\0foobar". */
for (i = 0; i < TREE_STRING_LENGTH (init); ++i)
if (TREE_STRING_POINTER (init)[i] != '\0')
return false;
return true;
}
default:
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment