@@ -1536,6 +1536,8 @@ check_format_arg (void *ctx, tree format_tree,
location_t fmt_param_loc = EXPR_LOC_OR_LOC (format_tree, input_location);
+ STRIP_ANY_LOCATION_WRAPPER (format_tree);
+
if (VAR_P (format_tree))
{
/* Pull out a constant value if the front end didn't. */
@@ -1598,6 +1600,7 @@ check_format_arg (void *ctx, tree format_tree,
}
res->format_string_loc = EXPR_LOC_OR_LOC (format_tree, input_location);
format_tree = TREE_OPERAND (format_tree, 0);
+ STRIP_ANY_LOCATION_WRAPPER (format_tree);
if (format_types[info->format_type].flags
& (int) FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL)
{
@@ -1634,7 +1637,10 @@ check_format_arg (void *ctx, tree format_tree,
if (TREE_CODE (format_tree) == ARRAY_REF
&& tree_fits_shwi_p (TREE_OPERAND (format_tree, 1))
&& (offset += tree_to_shwi (TREE_OPERAND (format_tree, 1))) >= 0)
- format_tree = TREE_OPERAND (format_tree, 0);
+ {
+ format_tree = TREE_OPERAND (format_tree, 0);
+ STRIP_ANY_LOCATION_WRAPPER (format_tree);
+ }
if (offset < 0)
{
res->number_non_literal++;
@@ -1650,6 +1656,7 @@ check_format_arg (void *ctx, tree format_tree,
const char a[3] = "foo";). */
array_size = DECL_SIZE_UNIT (format_tree);
format_tree = array_init;
+ STRIP_ANY_LOCATION_WRAPPER (format_tree);
}
if (TREE_CODE (format_tree) != STRING_CST)
{