瀏覽代碼

* avoid crashes with Nil dereferences

pierre 26 年之前
父節點
當前提交
5c5eecd993
共有 1 個文件被更改,包括 3 次插入1 次删除
  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);