Parcourir la source

* avoid crashes with Nil dereferences

pierre il y a 26 ans
Parent
commit
5c5eecd993
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      tests/ts/ts010001.pp

+ 3 - 1
tests/ts/ts010001.pp

@@ -32,11 +32,13 @@ begin
    { more difficult }
    classref:=myclassref;
    classref:=tobject;
+   myclassref:=tmyobject;
 
    classref:=getanchestor(myclassref);
    if (constclassref1.classname<>'TOBJECT') or
      (constclassref2<>nil) or
-     (constclassref2.classname<>'TMYOBJECT')then
+     (myclassref.classname<>'TMYOBJECT') or
+     (classref.classname<>'TOBJECT') then
      begin
         writeln('Error');
         halt(1);