bugGNU libavl - Bugs: bug #28857, redblack (only one tested) , if we...

 
 

bug #28857: redblack (only one tested) , if we call rb_t_next(struct rb_traverser *trav) after first NULL, weird.

Submitted by:  debricon <flipson>
Submitted on:  Wed 10 Feb 2010 09:17:54 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 10 Feb 2010 09:17:54 AM UTC, original submission:

the problem is when you call rb_t_next(struct rb_traverser *trav) another time after it has first return NULL, the behavior is undefined.

dirty hack : i add in struct rb_traverser the attribute first_time, and i modify rb_t_next.
oid *
rb_t_next(struct rb_traverser *trav)
{
struct rb_node *x;

assert (trav != NULL);

if (trav->rb_generation != trav->rb_table->rb_generation)
trav_refresh(trav);

x = trav->rb_node;
if (x == NULL && trav->first_time == 1)
{
trav->first_time = 0;
return rb_t_first(trav, trav->rb_table);
}
else if (x == NULL)
{
return NULL;
}

Laurent.

debricon <flipson>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by flipson (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup