Browse Source

taddnode.cmp_of_disjunct_ranges: fortify in case of programs with errors

Fixes compilation of webtbf/tw3116 with a compiler compiled with -Cr
Jonas Maebe 3 years ago
parent
commit
573f2c20d7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      compiler/nadd.pas

+ 3 - 0
compiler/nadd.pas

@@ -256,6 +256,9 @@ implementation
                  hp:=ttypeconvnode(hp).left;
                  realdef:=hp.resultdef;
                end;
+             { could become an errordef in case of errors }
+             if realdef.typ<>orddef then
+               exit;
              if is_constintnode(left) then
                with torddef(realdef) do
                  case nodetype of