mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
![Josh Bleecher Snyder](/assets/img/avatar_default.png)
Bool codegen was generating a temp for function calls and other complex expressions, but was not using it. This was a refactoring bug introduced by CL 7853. The cmp code used to do (in short): l, r := &n1, &n2 It was changed to: l, r := nl, nr But the requisite assignments: nl, nr = &n1, &n2 were only introduced on one of two code paths. Fixes #10654. Change-Id: Ie8de0b3a333842a048d4308e02911bb10c6915ce Reviewed-on: https://go-review.googlesource.com/10844 Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Minux Ma <minux@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
18 lines
351 B
Go
18 lines
351 B
Go
// compile
|
|
|
|
// Copyright 2015 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.
|
|
|
|
// Issue 10654: Failure to use generated temps
|
|
// for function calls etc. in boolean codegen.
|
|
|
|
package main
|
|
|
|
var s string
|
|
|
|
func main() {
|
|
if (s == "this") != (s == "that") {
|
|
}
|
|
}
|