httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: Endless loop in split_on_bdry() of library/parser_multipart.c?
Date Thu, 15 Jun 2006 23:15:06 GMT
Bojan Smojver <bojan@rexursive.com> writes:

> Quoting Joe Schaefer <joe+gmane@sunstarsys.com>:
>
>> This is the right approach, I think.  But the person who'd be
>> in the best place to test/commit it is Bojan.  Just be sure
>> to bump the patch level in apreq_version.h, and add a comment
>> to CHANGES.
>
> This code hangs the test (Joe Orton's original suggestion):
>
> -------------------------------
>             do {
>                 apr_bucket *f = APR_RING_FIRST(&in->list);
>                 apr_bucket *l = APR_RING_LAST(&in->list);
>                 APR_RING_UNSPLICE(f, l, link);
>                 APR_RING_SPLICE_TAIL(&out->list, f, l, apr_bucket, link);
>             } while (e != APR_BRIGADE_FIRST(in));
> -------------------------------
>
> This code also hangs the test (Joe Schaefer's subsequent suggestion):
>
> -------------------------------
>             do {
>                 apr_bucket *f = APR_RING_FIRST(&in->list);
>                 apr_bucket *l = APR_BUCKET_PREV(e);
>                 APR_RING_UNSPLICE(f, l, link);
>                 APR_RING_SPLICE_TAIL(&out->list, f, l, apr_bucket, link);
>             } while (e != APR_BRIGADE_FIRST(in));
> -------------------------------
>
> When compiled with -fno-strict-aliasing, Joe Schaefer's suggestion
> passes the test, Joe Orton's suggestion hangs the test.
>
> Or maybe I misunderstood what the code should actually be?


do { ... } while (0) is better- it's no longer a loop.
What is the assembler now?

-- 
Joe Schaefer


Mime
View raw message