https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99337

--- Comment #4 from Vittorio Zecca <zeccav at gmail dot com> ---
(In reply to Iain Buclaw from comment #3)
> Fix is trivial
> 
> --- a/gcc/d/dmd/dmodule.c
> +++ b/gcc/d/dmd/dmodule.c
> @@ -195,7 +195,7 @@ static void checkModFileAlias(OutBuffer *buf, OutBuffer
> *dotmods,
>          const char *m = (*ms)[j];
>          const char *q = strchr(m, '=');
>          assert(q);
> -        if (dotmods->length() <= (size_t)(q - m) &&
> memcmp(dotmods->peekChars(), m, q - m) == 0)
> +        if (dotmods->length() == (size_t)(q - m) &&
> memcmp(dotmods->peekChars(), m, q - m) == 0)
>          {
>              buf->reset();
>              size_t qlen = strlen(q + 1);

After applying the suggested fix

make check-gcc-d

runs without address sanitizer errors.

Reply via email to