Browse Source

* avoid crashes with Nil dereferences

pierre 26 years ago
parent
commit
5c5eecd993
1 changed files with 3 additions and 1 deletions
  1. 3 1
      tests/ts/ts010001.pp

+ 3 - 1
tests/ts/ts010001.pp

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