From a88d1f8bb2015c752fc783e168e25e5dab99a8b9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 25 Jan 2018 17:44:19 +0000 Subject: runtime: fix lfstackUnpack on ia64 The top three region number bits must be masked out before right-shifting the address bits into place, otherwise they will be copied down into the lower always-zero address bits. Reviewed-on: https://go-review.googlesource.com/84535 From-SVN: r257061 --- libgo/go/runtime/lfstack_64bit.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libgo') diff --git a/libgo/go/runtime/lfstack_64bit.go b/libgo/go/runtime/lfstack_64bit.go index 44cbf74..95d0eba 100644 --- a/libgo/go/runtime/lfstack_64bit.go +++ b/libgo/go/runtime/lfstack_64bit.go @@ -78,7 +78,7 @@ func lfstackUnpack(val uint64) *lfnode { return (*lfnode)(unsafe.Pointer(uintptr(int64(val) >> sparcLinuxCntBits << 3))) } if GOARCH == "ia64" { - return (*lfnode)(unsafe.Pointer(uintptr((val>>ia64CntBits<<3)&(1<<(64-3)-1) | val&^(1<<(64-3)-1)))) + return (*lfnode)(unsafe.Pointer(uintptr(((val & (1<<(64-3) - 1)) >> ia64CntBits << 3) | val&^(1<<(64-3)-1)))) } if GOARCH == "ppc64" && GOOS == "aix" { if val&(1<<63) != 0 { -- cgit v1.1