mirror of
https://github.com/golang/go
synced 2024-11-17 05:44:52 -07:00
b4ecafc986
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>
18 lines
287 B
Go
18 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)
|
|
}
|