8.2.3-tb5-rc3 patch

Paul A Vixie vixie at mibh.net
Thu Jun 8 07:59:07 UTC 2000


> 	This fixes a zero page read error that I was getting when fwd was
> == null.

can i see the result of "cc -S" from before and after this patch?

>          * XXX - should put this in STATS somewhere.
>          */
>         for (fwd = NS_ZFWDTAB(qp->q_fzone); fwd; fwd = fwd->next)
> +       {
> +               if (fwd == NULL)
> +                       break;
>                 if (ina_equal(fwd->fwddata->fwdaddr.sin_addr, from.sin_addr))
>                         break;
> +       }
>         /*
>         /*
>          * find the qinfo pointer and update

the "for" stmt's cond is out of style -- should be "fwd != NULL" rather
than "fwd" since pointer invocations are not a boolean expressions --
but the code that's generated ought be no different before and after your
patch.

[lahpaul.mibh:i386] diff -u foo.c foo2.c
--- foo.c       Thu Jun  8 00:57:17 2000
+++ foo2.c      Thu Jun  8 00:57:53 2000
@@ -1,6 +1,9 @@
 foo(int x) {
        int y;
 
-       for (y = x; y; y--)
+       for (y = x; y; y--) {
+               if (y == 0)
+                       break;
                bar(y);
+       }
 }
[lahpaul.mibh:i386] diff -u foo.s foo2.s
--- foo.s       Thu Jun  8 00:58:01 2000
+++ foo2.s      Thu Jun  8 00:58:00 2000
@@ -1,4 +1,4 @@
-       .file   "foo.c"
+       .file   "foo2.c"
        .version        "01.01"
 gcc2_compiled.:
 .text
@@ -13,12 +13,12 @@
        testl %ebx,%ebx
        je .L3
        .p2align 2,0x90
-.L5:
+.L8:
        pushl %ebx
        call bar
        addl $4,%esp
        decl %ebx
-       jne .L5
+       jne .L8
 .L3:
        movl -4(%ebp),%ebx
        leave



More information about the bind-workers mailing list