mirror of https://github.com/golang/go.git
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:
parent
2cbd7072b1
commit
dace9397b1
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue