Просмотр исходного кода

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 лет назад
Родитель
Сommit
573f2c20d7
1 измененных файлов с 3 добавлено и 0 удалено
  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