Browse Source

do_set: immediately exit in case of range error

Prevents run time error in case of a compiler compiled with range checks
enabled (webtbf/tw10890a)
Jonas Maebe 3 years ago
parent
commit
743d7c50d0
1 changed files with 4 additions and 1 deletions
  1. 4 1
      compiler/ncnv.pas

+ 4 - 1
compiler/ncnv.pas

@@ -480,7 +480,10 @@ implementation
         procedure do_set(pos : longint);
         procedure do_set(pos : longint);
           begin
           begin
             if (pos and not $ff)<>0 then
             if (pos and not $ff)<>0 then
-             Message(parser_e_illegal_set_expr);
+              begin
+                Message(parser_e_illegal_set_expr);
+                exit;
+              end;
             if pos>constsethi then
             if pos>constsethi then
              constsethi:=pos;
              constsethi:=pos;
             if pos<constsetlo then
             if pos<constsetlo then