From 12a18ca5430d7c1467e61777a0365880fbba07f8 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 27 Nov 2015 09:37:44 +0100 Subject: [PATCH] Fix parser memory leak in cilk_simd_fn_info * parser.c (cp_parser_late_parsing_cilk_simd_fn_info): Release tokens. From-SVN: r230996 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/parser.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1d6e252ebb1..eb4bb6810a1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-11-27 Martin Liska + + * parser.c (cp_parser_late_parsing_cilk_simd_fn_info): + Release tokens. + 2015-11-26 Andreas Arnez * cp-gimplify.c (genericize_cp_loop): Change LOOP_EXPR's location diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index a9c0a452d6b..6583d4ca7db 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -35015,6 +35015,7 @@ cp_parser_late_parsing_cilk_simd_fn_info (cp_parser *parser, tree attrs) error ("%<#pragma omp declare simd%> of % attribute cannot be " "used in the same function marked as a Cilk Plus SIMD-enabled " " function"); + parser->cilk_simd_fn_info->tokens.release (); XDELETE (parser->cilk_simd_fn_info); parser->cilk_simd_fn_info = NULL; return attrs; @@ -35052,6 +35053,7 @@ cp_parser_late_parsing_cilk_simd_fn_info (cp_parser *parser, tree attrs) attrs = c; } info->fndecl_seen = true; + parser->cilk_simd_fn_info->tokens.release (); XDELETE (parser->cilk_simd_fn_info); parser->cilk_simd_fn_info = NULL; return attrs; -- 2.30.2