Quellcode durchsuchen

* don't use pointer after free
* ensure the test tests the right thing and not the error message on missing -Sg

florian vor 2 Wochen
Ursprung
Commit
211db1d672
2 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 1 1
      compiler/pstatmnt.pas
  2. 1 0
      tests/webtbf/tw40118.pp

+ 1 - 1
compiler/pstatmnt.pas

@@ -811,9 +811,9 @@ implementation
           end
          else
           begin
+            Message1(parser_e_false_with_expr,p.resultdef.GetTypeName);
             p.free;
             p := nil;
-            Message1(parser_e_false_with_expr,p.resultdef.GetTypeName);
             { try to recover from error }
             if try_to_consume(_COMMA) then
              begin

+ 1 - 0
tests/webtbf/tw40118.pp

@@ -1,3 +1,4 @@
+{ %opt=-Sg }
 { %fail }
 program helloWorld;
  label