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

This commit is contained in:
florian 2022-11-02 22:13:40 +01:00
parent 05c45486e8
commit a0366d7d28

View File

@ -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));