tree-optimization/98192 - fix double free in SLP
authorRichard Biener <rguenther@suse.de>
Tue, 8 Dec 2020 11:54:48 +0000 (12:54 +0100)
committerRichard Biener <rguenther@suse.de>
Tue, 8 Dec 2020 11:56:44 +0000 (12:56 +0100)
This makes sure to clear the vector pointer on release.

2020-12-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/98192
* tree-vect-slp.c (vect_build_slp_instance): Get scalar_stmts
by reference.

gcc/tree-vect-slp.c

index 35e783505b4934fe7eef401f7f60390722e66204..d248ce2c3f71d947e950207a518707af59ab51eb 100644 (file)
@@ -2212,7 +2212,7 @@ vect_analyze_slp_instance (vec_info *vinfo,
 static bool
 vect_build_slp_instance (vec_info *vinfo,
                         slp_instance_kind kind,
-                        vec<stmt_vec_info> scalar_stmts,
+                        vec<stmt_vec_info> &scalar_stmts,
                         stmt_vec_info root_stmt_info,
                         unsigned max_tree_size,
                         scalar_stmts_to_slp_tree_map_t *bst_map,