Avoid -fsanitize=nullptr-with-offset

(new with recent Clang 10 trunk) during e.g. InstallModule_scp2/ooo:

> [SPP] scp2/source/ooo/common_brand
> soltools/cpp/_tokens.c:336:13: runtime error: applying zero offset to null pointer
>  #0 in copytokenrow at soltools/cpp/_tokens.c:336:13
>  #1 in expand at soltools/cpp/_macro.c:325:5
>  #2 in expandrow at soltools/cpp/_macro.c:292:13
>  #3 in process at soltools/cpp/_cpp.c:106:17
>  #4 in main at soltools/cpp/_cpp.c:60:5

Change-Id: Icbe1c105fbd0ff634f3e2966c27af1b89398be13
Reviewed-on: https://gerrit.libreoffice.org/81187
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2019-10-21 09:27:41 +02:00
parent 05e67eeb3d
commit a0f8df427e
+2 -1
View File
@@ -333,7 +333,8 @@ Tokenrow *
maketokenrow(len, dtr);
movetokenrow(dtr, str);
dtr->lp += len;
if (len != 0)
dtr->lp += len;
return dtr;
}