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.

Submitter:  debricon <flipson>
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code