]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix memory leak in pass_x86_cse
authorRichard Biener <rguenther@suse.de>
Thu, 13 Nov 2025 12:53:43 +0000 (13:53 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 13 Nov 2025 14:30:25 +0000 (15:30 +0100)
The following makes sure to delete the loads we previously allocated
with new.

gcc/
* config/i386/i386-features.cc (pass_x86_cse::x86_cse): Delete
loads.

gcc/config/i386/i386-features.cc

index 8e277843f23c5ab11aeb06fac55df52ac0a8781a..f1f118d5b755196187c2c98be891904447db5ce6 100644 (file)
@@ -4810,6 +4810,9 @@ pass_x86_cse::x86_cse (void)
       df_process_deferred_rescans ();
     }
 
+  FOR_EACH_VEC_ELT (loads, i, load)
+    delete load;
+
   df_clear_flags (DF_DEFER_INSN_RESCAN);
 
   timevar_pop (TV_MACH_DEP);