Sfoglia il codice sorgente

* do not crash on invalid property declaration, resolves #23980

git-svn-id: trunk@26818 -
florian 11 anni fa
parent
commit
6364cf412d
3 ha cambiato i file con 10 aggiunte e 1 eliminazioni
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/pdecvar.pas
  3. 8 0
      tests/webtbs/tw23980.pp

+ 1 - 0
.gitattributes

@@ -13750,6 +13750,7 @@ tests/webtbs/tw23912.pp svneol=native#text/plain
 tests/webtbs/tw23962.pp svneol=native#text/plain
 tests/webtbs/tw23963.pp svneol=native#text/plain
 tests/webtbs/tw2397.pp svneol=native#text/plain
+tests/webtbs/tw23980.pp svneol=native#text/pascal
 tests/webtbs/tw24007.pp svneol=native#text/plain
 tests/webtbs/tw24071.pp svneol=native#text/pascal
 tests/webtbs/tw2409.pp svneol=native#text/plain

+ 1 - 1
compiler/pdecvar.pas

@@ -484,7 +484,7 @@ implementation
          else
            begin
               { do an property override }
-              if (astruct.typ=objectdef) then
+              if (astruct.typ=objectdef) and assigned(tobjectdef(astruct).childof) then
                 overridden:=search_struct_member(tobjectdef(astruct).childof,p.name)
               else
                 overridden:=nil;

+ 8 - 0
tests/webtbs/tw23980.pp

@@ -0,0 +1,8 @@
+{ %fail }
+type TObj = object
+              property crashme;
+            end;
+
+begin
+end.
+