Re: Endless loop in split_on_bdry() of library/parser_multipart.c?
Joe Schaefer <[email protected]>
| Newsgroups | gmane.comp.apache.apreq |
|---|---|
| Message-ID | <[email protected]> |
Bojan Smojver <[email protected]> writes: > Quoting Joe Schaefer <[email protected]>: > >> Are you sure the "intermediate code" is correct? >> It's calling free and destroy, which makes me think >> that's some other "delete buckets" loop, not this one.> > > Nice catch! The correct snippet is: > > ------------------------------- > do { > apr_bucket *f = (&(in)->list)->next; > do { (((((f))))->link.prev)->link.next = ((((f))))->link.next; > (((((f))))->link.next)->link.prev = ((((f))))->link.prev; } while (0); > do { apr_bucket *ap__b = (f); do { ((((ap__b))))->link.next = > ((struct apr_bucket *)((char *)(((&(out)->list))) - ((long) (((char *) > (&(((struct apr_bucket*)((void *)0))->link))) - ((char *) ((void *)0)))))); > ((((ap__b))))->link.prev = (((struct apr_bucket *)((char *)(((&(out)->list))) > - ((long) (((char *) (&(((struct apr_bucket*)((void *)0))->link))) - ((char *) > ((void *)0)))))))->link.prev; ((((struct apr_bucket *)((char > *)(((&(out)->list))) - ((long) (((char *) (&(((struct apr_bucket*)((void > *)0))->link))) - ((char *) ((void *)0)))))))->link.prev)->link.next = > (((ap__b))); (((struct apr_bucket *)((char *)(((&(out)->list))) - ((long) > (((char *) (&(((struct apr_bucket*)((void *)0))->link))) - ((char *) ((void > *)0)))))))->link.prev = (((ap__b))); } while (0); ; } while (0); > } while (e != (&(in)->list)->next); > ------------------------------- At least now it's a bit clearer why the no-strict-aliasing optimization is getting confused ;-) -- Joe Schaefer