aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-pretty-print.c
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2017-08-14 18:35:13 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2017-08-14 12:35:13 -0600
commitda67acb9b37cf139da014f5bc11e2dbf25a7d597 (patch)
treed3cc608c3e0c1104bf054ef4e742c6af1439c24f /gcc/tree-pretty-print.c
parent9e3b1778b6207a10f2f1534fc9f01e6c8320a1dc (diff)
downloadgcc-da67acb9b37cf139da014f5bc11e2dbf25a7d597.zip
gcc-da67acb9b37cf139da014f5bc11e2dbf25a7d597.tar.gz
gcc-da67acb9b37cf139da014f5bc11e2dbf25a7d597.tar.bz2
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. From-SVN: r251098
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 4d8177c..c7509af 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)