]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: make assignop/convertop reason a return param
authorAlberto Donizetti <alb.donizetti@gmail.com>
Tue, 13 Oct 2020 13:58:10 +0000 (15:58 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Thu, 15 Oct 2020 18:08:54 +0000 (18:08 +0000)
commit8773d141641708574654c617b686a7fd687c3f70
treef898f0a6fe3b04c8c58d891e7dc934fd3c3c7722
parent3c9488edff40f9837dfef94554ac638433708a65
cmd/compile: make assignop/convertop reason a return param

On a negative answer, the assignop and convertop functions write the
reason why to a string pointer passed as an argument, likely a C-ism
leftover since the compiler's machine assisted translation to Go.

This change makes why a return parameter.

It also fixes a few places where the assignop/convertop result was
compared to 0. While OXXX's value may be zero now, using the named
constant is more robust.

Change-Id: Id9147ed4c1b97d658d30a2f778f876b7867006b4
Reviewed-on: https://go-review.googlesource.com/c/go/+/261857
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
src/cmd/compile/internal/gc/range.go
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/swt.go
src/cmd/compile/internal/gc/typecheck.go