Browse Source

* decide more sophisticately if a temp. var is needed for fixing #40618

florian 1 year ago
parent
commit
d44cae14f5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      compiler/nset.pas

+ 1 - 1
compiler/nset.pas

@@ -958,7 +958,7 @@ implementation
                    caddnode.create_internal(equaln,left.getcopy,cordconstnode.create(flabels^._low,left.resultdef,false)),
                    pcaseblock(blocks[flabels^.blockid])^.statement,elseblock);
                end
-             else if left.nodetype in [loadn,temprefn] then
+             else if not(might_have_sideeffects(left,[mhs_exceptions])) and (node_complexity(left)<=1) then
                begin
                  result:=cifnode.create_internal(
                    caddnode.create_internal(andn,