Commit dace9397 authored by Robert Griesemer's avatar Robert Griesemer

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

Fixes #11600.

Change-Id: I8871d4e525168fed35115855483a237bbd6e5445
Reviewed-on: https://go-review.googlesource.com/14596Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 2cbd7072
......@@ -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)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment