소스 검색

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

florian 19 시간 전
부모
커밋
211db1d672
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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