]> Cypherpunks repositories - gostls13.git/commitdiff
liblink: fix precedence bug in pcdata comparison
authorRuss Cox <rsc@golang.org>
Wed, 16 Jul 2014 23:26:36 +0000 (19:26 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 16 Jul 2014 23:26:36 +0000 (19:26 -0400)
As written, the ! applies before the &1.
This would crash writing out missing pcdata tables
if we ever used non-contiguous IDs in a function.
We don't, but fix anyway.

LGTM=iant, minux
R=minux, iant
CC=golang-codereviews
https://golang.org/cl/117810047

src/liblink/pcln.c

index 4b2b85543e01465f511188796dfc39df4df8355b..f0ee1dc6726c9cdc5adcdd1a61b039c667576b44 100644 (file)
@@ -279,7 +279,7 @@ linkpcln(Link *ctxt, LSym *cursym)
        }
        // pcdata.
        for(i=0; i<npcdata; i++) {
-               if(!(havepc[i/32]>>(i%32))&1
+               if(((havepc[i/32]>>(i%32))&1) == 0
                        continue;
                funcpctab(ctxt, &pcln->pcdata[i], cursym, "pctopcdata", pctopcdata, (void*)(uintptr)i);
        }