]> Cypherpunks repositories - gostls13.git/commit
[dev.ssa] cmd/compile: make zero-divide panic from div/mod explicit
authorDavid Chase <drchase@google.com>
Wed, 28 Oct 2015 17:55:46 +0000 (13:55 -0400)
committerDavid Chase <drchase@google.com>
Wed, 28 Oct 2015 19:31:11 +0000 (19:31 +0000)
commit18559e2da7a2698ad9e35072cbcba1a05ed73836
tree33c706574de253061cd40c2b0d3b91ebd9e89d5d
parentc24681ae2e1c96bd67c149cffa8f5ed394e68453
[dev.ssa] cmd/compile: make zero-divide panic from div/mod explicit

Added an explicit compare-zero and branch-to-panic for
integer division and mod so that other optimizations will
not be fooled by their implicit panics.

Change-Id: Ibf96f636b541c0088861907c537a6beb4b99fa4c
Reviewed-on: https://go-review.googlesource.com/16450
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/go.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/ssa.go