diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-09-25 14:24:11 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-09-25 14:24:11 +0000 |
commit | a6871bda07973b01bb6472dbd4cac03339cce8e2 (patch) | |
tree | 21100e9b2f3e1a93346e76fdaba64fa8547b8ad1 /gcc/pretty-print.h | |
parent | b0d054a98e062cb8541c1dd00bdae82d5ee4dc9e (diff) | |
download | gcc-a6871bda07973b01bb6472dbd4cac03339cce8e2.tar.gz |
PR pretty-print/67567 do not pass NULL as a string
Fortran passes NULL where a non-null string is expected by the pretty-printer,
which causes a sanitizer warning. This could have been found earlier by using
gcc_checking_assert. Even if the assertion is false, the result is just an
incomplete diagnostic, thus it seems more user-friendly to assert only when
checking. I do not have any idea how to properly fix the Fortran bug, thus this
patch simply works-around it.
gcc/fortran/ChangeLog:
2015-09-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR pretty-print/67567
* resolve.c (resolve_fl_procedure): Work-around when iface->module
== NULL.
gcc/ChangeLog:
2015-09-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR pretty-print/67567
* pretty-print.c (pp_string): Add gcc_checking_assert.
* pretty-print.h (output_buffer_append_r): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228131 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/pretty-print.h')
-rw-r--r-- | gcc/pretty-print.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h index 36d4e37a0d2..2654b0fcbec 100644 --- a/gcc/pretty-print.h +++ b/gcc/pretty-print.h @@ -139,6 +139,7 @@ output_buffer_formatted_text (output_buffer *buff) static inline void output_buffer_append_r (output_buffer *buff, const char *start, int length) { + gcc_checking_assert (start); obstack_grow (buff->obstack, start, length); buff->line_length += length; } |