Hi, Simple case of operator precedence. As you have it if _active == 2 then action() will execute even if p == null
Change to: if (p && (((size() >= _limitToMark ) && _active==1 ) || _active==2)) Beyers On Tue, Oct 13, 2009 at 3:35 PM, <[email protected]> wrote: > Help needed ! > > In witch cases may the uniqueify() create a segmentation fault? > > with this code, a seg fault occurs just after the uniqueify() line. > Packet * > SimpleQueueWithQoS::pull(int) > { > Packet *p = deq(); > if (p && ( (size() >= _limitToMark ) && _active==1 ) || _active==2) > p = action(p); > return p; > } > > Packet * > SimpleQueueWithQoS::action(Packet *p_in) > { > click_chatter("before"); > WritablePacket *pp; > pp = p_in->uniqueify(); > click_chatter("after"); > /* assert(p->has_network_header()); > > > Thanks > > > _______________________________________________ > click mailing list > [email protected] > https://amsterdam.lcs.mit.edu/mailman/listinfo/click > _______________________________________________ click mailing list [email protected] https://amsterdam.lcs.mit.edu/mailman/listinfo/click
