From 633dd7f75ed3042a0f08a72f0366409c9a3b0e50 Mon Sep 17 00:00:00 2001 From: marxin Date: Fri, 27 Nov 2015 08:37:44 +0000 Subject: [PATCH] Fix parser memory leak in cilk_simd_fn_info * parser.c (cp_parser_late_parsing_cilk_simd_fn_info): Release tokens. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230996 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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.11.4.GIT