diff options
author | Aditya Kumar <aditya.k7@samsung.com> | 2016-01-21 02:13:24 +0000 |
---|---|---|
committer | Sebastian Pop <spop@gcc.gnu.org> | 2016-01-21 02:13:24 +0000 |
commit | eaca025e57accd92cabab3eaf09d5a27e056d184 (patch) | |
tree | 0f18bd5e48a0600f436107af1869c0ab2dd0bf38 /gcc/graphite-scop-detection.c | |
parent | 5431c9ea56229569343aa9ddc6b176916b41f248 (diff) | |
download | gcc-eaca025e57accd92cabab3eaf09d5a27e056d184.tar.gz |
fix memory leak in scop-detection
* graphite-scop-detection.c
(scop_detection::harmful_loop_in_region): Free dom and loops.
(scop_detection::loop_body_is_valid_scop): Free bbs.
Co-Authored-By: Sebastian Pop <s.pop@samsung.com>
From-SVN: r232655
Diffstat (limited to 'gcc/graphite-scop-detection.c')
-rw-r--r-- | gcc/graphite-scop-detection.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index 68b9f4df863..d1b0fec1d4b 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -1088,7 +1088,11 @@ scop_detection::harmful_loop_in_region (sese_l scop) const any loop fully contained in the scop: other bbs are checked below in loop_is_valid_in_scop. */ if (harmful_stmt_in_bb (scop, bb)) - return true; + { + dom.release (); + BITMAP_FREE (loops); + return true; + } } } @@ -1104,13 +1108,14 @@ scop_detection::harmful_loop_in_region (sese_l scop) const if (!loop_is_valid_in_scop (loop, scop)) { + dom.release (); BITMAP_FREE (loops); return true; } } - BITMAP_FREE (loops); dom.release (); + BITMAP_FREE (loops); return false; } @@ -1503,7 +1508,10 @@ scop_detection::loop_body_is_valid_scop (loop_p loop, sese_l scop) const basic_block bb = bbs[i]; if (harmful_stmt_in_bb (scop, bb)) - return false; + { + free (bbs); + return false; + } } free (bbs); |