@@ -888,7 +888,7 @@ unit optdfa;
exit;
include(node.flags,nf_processing);
- if not(DFASetIn(node.optinfo^.life,nodetosearch.optinfo^.index)) then
+ if not(assigned(node.optinfo)) or not(DFASetIn(node.optinfo^.life,nodetosearch.optinfo^.index)) then
{ we do not need this info always, so try to safe some time here, CheckAndWarn
@@ -0,0 +1,32 @@
+{ %opt=-O3 }
+{$mode objfpc}{$H+}
+
+type
+ TDynCardinalArray = array of Cardinal;
+function Test(N: Cardinal): TDynCardinalArray;
+var
+ L: Cardinal;
+begin
+ SetLength(Result, 0);
+ if N <= 1 then
+ Exit
+ else
+ begin
+ L := 0;
+ if N mod 2 = 0 then
+ Inc(L);
+ SetLength(Result, L);
+ Result[L - 1] := 2;
+ end;
+ Result[L - 1] := N;
+end;
+ Test(2);
+ WriteLn('OK');
+end.