Browse Source

* do not crash on illegal with statement, resolves #40118

florian 2 years ago
parent
commit
55deefbab5
2 changed files with 8 additions and 1 deletions
  1. 1 1
      compiler/pstatmnt.pas
  2. 7 0
      tests/webtbf/tw40118.pp

+ 1 - 1
compiler/pstatmnt.pas

@@ -819,7 +819,7 @@ implementation
                if token<>_SEMICOLON then
                 statement;
              end;
-            result:=nil;
+            result:=cerrornode.create;
           end;
       end;
 

+ 7 - 0
tests/webtbf/tw40118.pp

@@ -0,0 +1,7 @@
+{ %fail }
+program helloWorld;
+ label
+  1;
+ begin
+ 1:with true do
+ end.