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:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Add a New Comment(Rich 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.3