mirror of
https://github.com/golang/go.git
synced 2025-11-07 12:11:00 +00:00
The {AND,OR,XOR}const ops can only take an int32 as an argument.
Make sure that when rewriting a BTx op to one of these, the result
has no high-order bits.
Fixes #38746
Change-Id: Ia7c5f76952329f60974bc033c29a5433610f3b28
Reviewed-on: https://go-review.googlesource.com/c/go/+/231977
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
17 lines
287 B
Go
17 lines
287 B
Go
// compile
|
|
|
|
// Copyright 2020 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
var g *uint64
|
|
|
|
func main() {
|
|
var v uint64
|
|
g = &v
|
|
v &^= (1 << 31)
|
|
v |= 1 << 63
|
|
v &^= (1 << 63)
|
|
}
|