Browse Source

* if the debug info of a parent def is considered as queued then ensure that it is indeed queued (if it should already be in the list then the duplicate entry would have the state written if it's checked and thus ignored)
+ added test

git-svn-id: trunk@37969 -

svenbarth 7 năm trước cách đây
mục cha
commit
22932493b9
4 tập tin đã thay đổi với 74 bổ sung1 xóa
  1. 2 0
      .gitattributes
  2. 5 1
      compiler/dbgbase.pas
  3. 23 0
      tests/tbs/tb0635.pp
  4. 44 0
      tests/tbs/ub0635.pp

+ 2 - 0
.gitattributes

@@ -11478,6 +11478,7 @@ tests/tbs/tb0631.pp svneol=native#text/pascal
 tests/tbs/tb0632.pp svneol=native#text/pascal
 tests/tbs/tb0633.pp svneol=native#text/pascal
 tests/tbs/tb0634.pp svneol=native#text/pascal
+tests/tbs/tb0635.pp svneol=native#text/pascal
 tests/tbs/tb205.pp svneol=native#text/plain
 tests/tbs/tb610.pp svneol=native#text/pascal
 tests/tbs/tb613.pp svneol=native#text/plain
@@ -11518,6 +11519,7 @@ tests/tbs/ub0489b.pp svneol=native#text/plain
 tests/tbs/ub0506.pp svneol=native#text/plain
 tests/tbs/ub0569.pp svneol=native#text/pascal
 tests/tbs/ub0629.pp svneol=native#text/pascal
+tests/tbs/ub0635.pp svneol=native#text/pascal
 tests/test/README.txt svneol=native#text/plain
 tests/test/alglib/t_testconvunit.pp svneol=native#text/plain
 tests/test/alglib/t_testcorrunit.pp svneol=native#text/plain

+ 5 - 1
compiler/dbgbase.pas

@@ -326,7 +326,11 @@ implementation
                          (tobjectdef(def).childof.dbg_state=dbg_state_written) then
                         appenddef(list,def)
                       else if tobjectdef(def).childof.dbg_state=dbg_state_queued then
-                        deftowritelist.add(def)
+                        begin
+                          { ensure that the parent is indeed queued }
+                          deftowritelist.add(tobjectdef(def).childof);
+                          deftowritelist.add(def);
+                        end
                       else if tobjectdef(def).childof.dbg_state=dbg_state_used then
                         { comes somewhere after the current def in the looplist
                           and will be written at that point, so we will have to

+ 23 - 0
tests/tbs/tb0635.pp

@@ -0,0 +1,23 @@
+{ %OPT=-gs }
+
+unit tb0635;
+
+{$mode objfpc}
+
+INTERFACE
+uses ub0635;
+
+type
+  TAnalyser = Class (TNode)
+    end;
+
+  TStat  = Class (TAnalyser) //eine Eingangsgruppe, kein Ausgang
+    end;
+
+//**************************************************************************************
+IMPLEMENTATION
+
+
+begin
+end.
+

+ 44 - 0
tests/tbs/ub0635.pp

@@ -0,0 +1,44 @@
+unit ub0635;
+
+{$mode objfpc}
+
+INTERFACE
+
+type
+  TNode         = Class;
+  TSortableNode = Class;
+  TAdminNode = Class;
+    TGuardNode    = Class;
+
+  TBaseSystem = Class
+  strict private
+    fEvList       : TSortableNode;
+    fGuard        : TGuardNode;
+  end;
+
+  TNode = Class
+      fOwner     : TBaseSystem;
+    end;
+
+  TSortableNode = Class (TNode)
+    end;
+
+  TAnalyser = Class (TNode)
+    end;
+
+  TStat  = Class (TAnalyser)
+    end;
+
+
+  TAdminNode = Class (TSortableNode)
+    end;
+
+  TGuardNode = Class (TAdminNode)
+    end;
+
+
+IMPLEMENTATION
+
+begin
+end.
+