Skip to content

Commit 390b236

Browse files
committed
1 parent 781f2fc commit 390b236

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

gcc/c/c-parser.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,10 +1862,15 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok,
18621862
/* A parameter is initialized, which is invalid. Don't
18631863
attempt to instrument the initializer. */
18641864
int flag_sanitize_save = flag_sanitize;
1865+
int flag_sanitize_local_save = flag_sanitize_local;
18651866
if (nested && !empty_ok)
1866-
flag_sanitize = 0;
1867+
{
1868+
flag_sanitize = 0;
1869+
flag_sanitize_local = 0;
1870+
}
18671871
init = c_parser_expr_no_commas (parser, NULL);
18681872
flag_sanitize = flag_sanitize_save;
1873+
flag_sanitize_local = flag_sanitize_local_save;
18691874
if (TREE_CODE (init.value) == COMPONENT_REF
18701875
&& DECL_C_BIT_FIELD (TREE_OPERAND (init.value, 1)))
18711876
error_at (here,

gcc/cp/typeck.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3409,7 +3409,7 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function,
34093409
idx = build1 (NOP_EXPR, vtable_index_type, e3);
34103410
switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
34113411
{
3412-
int flag_sanitize_save;
3412+
int flag_sanitize_save, flag_sanitize_local_save;
34133413
case ptrmemfunc_vbit_in_pfn:
34143414
e1 = cp_build_binary_op (input_location,
34153415
BIT_AND_EXPR, idx, integer_one_node,
@@ -3429,11 +3429,14 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function,
34293429
we're going to use DELTA number of times, and that wouldn't play
34303430
well with SAVE_EXPRs therein. */
34313431
flag_sanitize_save = flag_sanitize;
3432+
flag_sanitize_local_save = flag_sanitize_local;
34323433
flag_sanitize = 0;
3434+
flag_sanitize_local = 0;
34333435
delta = cp_build_binary_op (input_location,
34343436
RSHIFT_EXPR, delta, integer_one_node,
34353437
complain);
34363438
flag_sanitize = flag_sanitize_save;
3439+
flag_sanitize_local = flag_sanitize_local_save;
34373440
if (delta == error_mark_node)
34383441
return error_mark_node;
34393442
break;

0 commit comments

Comments
 (0)