* tree.c (initializer_zerop): Handle STRING_CST.
From-SVN: r159103
This commit is contained in:
parent
3734d9607e
commit
315a02daf1
2 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
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
|
||||
|
|
13
gcc/tree.c
13
gcc/tree.c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue