Linked lists

From: The /\\\\o//\\annabee (Faq(Sqeeeek!)_at_.@szmyggenpv.com)
Date: 12/31/04


Date: Fri, 31 Dec 2004 13:21:03 +0100

Seriously.

Can someone help me verify the logic of this
code ? the more I look at it, the more I am convinced it should work,
but some bugs arises when I enable it....and the bug is an endless loop.
So, that is probably because some wrong relinking of the linked list.
Can you spot the error? I must have become blind from looking at it....

SkinWindow.AddSectionToHiddenList:
   push D$esi + SkinWindow.HiddenSections ;pushes the first
section in list or NULL
     mov D$esi + SkinWindow.HiddenSections edi ;Moves a section to
the front of the list
   pop D$edi + SkinSection.HiddenNext ;pops the back of the
previous list
ret

For the above we should have either :
ListHeader --> Section1 --> NULL
ListHeader --> Section2 --> Section1 --> NULL
etc.

------------------------
then, here is the code that maybe introduses the bug. It would be good if
a couple of experienced eyes could look at it and verify the logic is
correct.

What we do here is search the list, and when we find the item to be
removed from the list,
by comparing it (EDI) to each item

SkinWindow.RemoveSectionFromHiddenList:
   ifAssigned D$esi + SkinWindow.HiddenSections
         mov eax D$esi + SkinWindow.HiddenSections
         mov ecx 0
         ___________________________;search
         While eax <> edi
           mov ecx eax
           mov eax D$eax + SkinSection.HiddenNext
           cmp eax 0 | je L7>
         End_While

         ;now eax = edi

         ____________________________;needs verified :
          push D$eax + SkinSection.HiddenNext ;push next or NULL
         if ecx <> 0
            pop D$ecx + SkinSection.HiddenNext ;link previous to
after or NULL
         else
            pop D$esi + SkinWindow.HiddenSections ;terminate or
shorten list
         end_if

         mov D$edi + SkinSection.HiddenNext 0 ;delete from list
         L7:
   EndIfAssigned
ret

Thanks.

-- 


Relevant Pages

  • Re: has K3B been abandoned?
    ... I gave up on asking k3b to verify anything. ... Then it waits for the disk to be recognized by the ... but a simple lack of a time delay bug is too ... I had the identical problem with Nautilus so K3B is not the problem ...
    (Fedora)
  • [Full-disclosure] Counter-Strike bug in name command?
    ... I ran into a problem yesterday and now request the assistance of others ... to verify or test for the bug, in case it affects more than my setup. ... but it does crash my client. ...
    (Full-Disclosure)
  • Re: Linked lists
    ... > but some bugs arises when I enable it....and the bug is an endless loop. ... I must have become blind from looking at it.... ... > a couple of experienced eyes could look at it and verify the logic is ...
    (alt.lang.asm)
  • Re: [patch 2.6.28-rc2] atmel_serial: keep clock off when its not needed
    ... other USARTs do get an open. ... Didn't verify on AVR32, since 2.6.28-rc can't see the root FS because ... board will lock up solid with no console output since it will wait ... Fixing a bug by introducing a worse one isn't much of an improvement. ...
    (Linux-Kernel)
  • Re: [kde-linux] k3b wont verify data
    ... I tell it to verify data after burning, it completes the burn, pops ... open the CD tray, waits patiently until I push the tray back in. ... This bug has been there quite a while. ... It's not a simple k3b bug - verify works fine on many/most drives. ...
    (KDE)