Jakub Jelinek <ja...@redhat.com> writes:

> On Wed, Oct 26, 2011 at 10:22:21PM -0700, Ian Lance Taylor wrote:
>> I don't think it is possible to trigger this using C because I don't
>> think it is possible to have a zero-length STRING_CST in C.
>
> Ugh.
>
> I think the following should work, after all it will be tiny more efficient,
> I chose to use c_strlen just to avoid some code duplication.
> c_strlen will return even variable lengths etc. and we are only interested
> in constant string lengths, etc.  If c_strlen is only called in places which
> expect zero-terminated strings, it will be fine.
>
> 2011-10-27  Jakub Jelinek  <ja...@redhat.com>
>
>       * tree-ssa-strlen.c: Include expr.h.
>       (get_stridx): Don't use c_strlen, instead use string_constant
>       and compute string length from it.
>       * Makefile.in (tree-ssa-strlen.o): Depend on $(EXPR_H).

Looks good to me.

Thanks.

Ian

Reply via email to