]> Cypherpunks repositories - gostls13.git/commit
cmd/link: fix zig-zag decoding
authorMatthew Dempsky <mdempsky@google.com>
Mon, 11 Aug 2014 17:53:38 +0000 (13:53 -0400)
committerRuss Cox <rsc@golang.org>
Mon, 11 Aug 2014 17:53:38 +0000 (13:53 -0400)
commiteae9fee3bf8c58c7403bcd103050ef2196fdfed1
tree13505480f67aa42fb666483ec02a1b7000d730e0
parent5a17aaa830a5951d2dc24aabb6c267d224a6b697
cmd/link: fix zig-zag decoding

The >>1 shift needs to happen before converting to int32, otherwise
large values will decode with an incorrect sign bit.

The <<31 shift can happen before or after, but before is consistent
with liblink and the go12symtab doc.

Bug demo at http://play.golang.org/p/jLrhPUakIu

LGTM=rsc
R=golang-codereviews, minux, rsc
CC=golang-codereviews
https://golang.org/cl/119630043
src/cmd/link/pclntab.go