aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-14 18:35:13 +0000
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-14 18:35:13 +0000
commitc8616982bf80f59b0fc485b5993a0adf7821ae94 (patch)
treed3cc608c3e0c1104bf054ef4e742c6af1439c24f /gcc/tree-pretty-print.c
parentd5e69e3759d3925e04ab02027a0074f037851b81 (diff)
PR c/81117 - Improve buffer overflow checking in strncpy - part 1
gcc/ChangeLog: PR c/81117 * tree-diagnostic.c (default_tree_printer): Handle %G. * gimple-pretty-print.h (percent_G_format): Declare new function. * gimple-pretty-print.c (percent_G_format): Define. * tree-pretty-print.c (percent_K_format): Add argument. gcc/c/ChangeLog: PR c/81117 * c-objc-common.c (c_objc_common_init): Handle 'G'. gcc/c-family/ChangeLog: PR c/81117 * c-format.h (T89_G): New macro. * c-format.c (local_gcall_ptr_node): New variable. (init_dynamic_diag_info): Initialize it. gcc/cp/ChangeLog: PR c/81117 * error.c (cp_printer): Handle 'G'. gcc/testsuite/ChangeLog: PR c/81117 * gcc.dg/format/gcc_diag-10.c: Exercise %G. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@251098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-pretty-print.c')
-rw-r--r--gcc/tree-pretty-print.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index 4d8177c4a62..c7509af198b 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -33,6 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "dumpfile.h"
#include "internal-fn.h"
#include "gomp-constants.h"
+#include "gimple.h"
/* Local functions, macros and variables. */
static const char *op_symbol (const_tree);
@@ -3970,18 +3971,17 @@ newline_and_indent (pretty_printer *pp, int spc)
INDENT (spc);
}
-/* Handle a %K format for TEXT. Separate from default_tree_printer so
- it can also be used in front ends.
- %K: a statement, from which EXPR_LOCATION and TREE_BLOCK will be recorded.
-*/
+/* Handle the %K format for TEXT. Separate from default_tree_printer
+ so it can also be used in front ends.
+ Argument is a statement from which EXPR_LOCATION and TREE_BLOCK will
+ be recorded. */
void
-percent_K_format (text_info *text)
+percent_K_format (text_info *text, tree t)
{
- tree t = va_arg (*text->args_ptr, tree), block;
text->set_location (0, EXPR_LOCATION (t), true);
gcc_assert (pp_ti_abstract_origin (text) != NULL);
- block = TREE_BLOCK (t);
+ tree block = TREE_BLOCK (t);
*pp_ti_abstract_origin (text) = NULL;
if (in_lto_p)