Kaynağa Gözat

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

florian 1 hafta önce
ebeveyn
işleme
211db1d672
2 değiştirilmiş dosya ile 2 ekleme ve 1 silme
  1. 1 1
      compiler/pstatmnt.pas
  2. 1 0
      tests/webtbf/tw40118.pp

+ 1 - 1
compiler/pstatmnt.pas

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

+ 1 - 0
tests/webtbf/tw40118.pp

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