Jelajahi Sumber

* dead store elimnation should not remove statements which can cause an exception

florian 2 tahun lalu
induk
melakukan
a0366d7d28
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      compiler/optdeadstore.pas

+ 1 - 1
compiler/optdeadstore.pas

@@ -79,7 +79,7 @@ unit optdeadstore;
                     ((a.right.nodetype in [niln,stringconstn,pointerconstn,setconstn,guidconstn]) or
                      ((a.right.nodetype=ordconstn) and not(cs_check_range in current_settings.localswitches)) or
                      ((a.right.nodetype=realconstn) and not(cs_ieee_errors in current_settings.localswitches)) or
-                    ((cs_opt_dead_values in current_settings.optimizerswitches) and not(might_have_sideeffects(a.right)))
+                    ((cs_opt_dead_values in current_settings.optimizerswitches) and not(might_have_sideeffects(a.right,[mhs_exceptions])))
                    ) then
                   begin
                     redundant:=not(assigned(a.successor)) or not(DFASetIn(a.successor.optinfo^.life,a.left.optinfo^.index));