src/cmd/compile/internal/gc: fix type assertion in overflow check

Fixes #11600.

Change-Id: I8871d4e525168fed35115855483a237bbd6e5445
Reviewed-on: https://go-review.googlesource.com/14596
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
Robert Griesemer 2015-09-15 11:16:58 -07:00
parent 2cbd7072b1
commit dace9397b1
1 changed files with 2 additions and 13 deletions

View File

@ -434,19 +434,8 @@ func overflow(v Val, t *Type) {
return
}
if !doesoverflow(v, t) {
return
}
switch v.Ctype() {
case CTINT, CTRUNE:
Yyerror("constant %v overflows %v", v.U.(*Mpint), t)
case CTFLT:
Yyerror("constant %v overflows %v", Fconv(v.U.(*Mpflt), obj.FmtSharp), t)
case CTCPLX:
Yyerror("constant %v overflows %v", Fconv(v.U.(*Mpflt), obj.FmtSharp), t)
if doesoverflow(v, t) {
Yyerror("constant %s overflows %v", Vconv(v, 0), t)
}
}