Bläddra i källkod

* added missing assignment check when searching for a symbol in a class, fixing bug #9673
* test program for above

git-svn-id: trunk@8579 -

tom_at_work 18 år sedan
förälder
incheckning
37695af02b
3 ändrade filer med 22 tillägg och 1 borttagningar
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/symtable.pas
  3. 20 0
      tests/webtbs/tw9673.pp

+ 1 - 0
.gitattributes

@@ -8458,6 +8458,7 @@ tests/webtbs/tw9347b.pp svneol=native#text/plain
 tests/webtbs/tw9384.pp svneol=native#text/plain
 tests/webtbs/tw9384.pp svneol=native#text/plain
 tests/webtbs/tw9385.pp svneol=native#text/plain
 tests/webtbs/tw9385.pp svneol=native#text/plain
 tests/webtbs/tw9672.pp svneol=native#text/plain
 tests/webtbs/tw9672.pp svneol=native#text/plain
+tests/webtbs/tw9673.pp -text
 tests/webtbs/tw9695.pp svneol=native#text/plain
 tests/webtbs/tw9695.pp svneol=native#text/plain
 tests/webtbs/tw9704.pp svneol=native#text/plain
 tests/webtbs/tw9704.pp svneol=native#text/plain
 tests/webtbs/tw9766.pp svneol=native#text/plain
 tests/webtbs/tw9766.pp svneol=native#text/plain

+ 1 - 1
compiler/symtable.pas

@@ -1658,7 +1658,7 @@ implementation
       begin
       begin
         result:=false;
         result:=false;
         hashedid.id:=s;
         hashedid.id:=s;
-        if assigned(current_procinfo.procdef) then
+        if assigned(current_procinfo) and assigned(current_procinfo.procdef) then
           currentclassh:=current_procinfo.procdef._class
           currentclassh:=current_procinfo.procdef._class
         else
         else
           currentclassh:=nil;
           currentclassh:=nil;

+ 20 - 0
tests/webtbs/tw9673.pp

@@ -0,0 +1,20 @@
+unit tw9673;
+
+interface
+{$mode objfpc}
+
+type
+  Testclass = class
+  
+  type
+    TList = array of byte;
+	
+  end;
+	    
+var
+  b : Testclass.TList;
+	      
+	    
+implementation
+begin
+end.