re PR libfortran/81984 (NULL string pointer dereferencing forces undefined behaviour in libgfortran)
2018-12-28 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/81984 * intrinsics/string_intrinsics_inc.c: Placate the sanitizer. From-SVN: r267452
This commit is contained in:
parent
691adeb097
commit
07b700ead5
@ -1,3 +1,8 @@
|
||||
2018-12-28 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/81984
|
||||
* intrinsics/string_intrinsics_inc.c: Placate the sanitizer.
|
||||
|
||||
2018-12-21 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||
|
||||
PR fortran/69121
|
||||
|
@ -87,6 +87,14 @@ compare_string (gfc_charlen_type len1, const CHARTYPE *s1,
|
||||
gfc_charlen_type len;
|
||||
int res;
|
||||
|
||||
/* Placate the sanitizer. */
|
||||
if (!s1 && !s2)
|
||||
return 0;
|
||||
if (!s1)
|
||||
return -1;
|
||||
if (!s2)
|
||||
return 1;
|
||||
|
||||
res = MEMCMP (s1, s2, ((len1 < len2) ? len1 : len2));
|
||||
if (res != 0)
|
||||
return res;
|
||||
|
Loading…
Reference in New Issue
Block a user