summaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/mpint.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/gc/mpint.go')
-rw-r--r--src/cmd/compile/internal/gc/mpint.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/cmd/compile/internal/gc/mpint.go b/src/cmd/compile/internal/gc/mpint.go
index e4dd22d0a0..340350bca7 100644
--- a/src/cmd/compile/internal/gc/mpint.go
+++ b/src/cmd/compile/internal/gc/mpint.go
@@ -283,15 +283,11 @@ func (a *Mpint) SetInt64(c int64) {
func (a *Mpint) SetString(as string) {
_, ok := a.Val.SetString(as, 0)
if !ok {
- // required syntax is [+-][0[x]]d*
- // At the moment we lose precise error cause;
- // the old code distinguished between:
- // - malformed hex constant
- // - malformed octal constant
- // - malformed decimal constant
- // TODO(gri) use different conversion function
- yyerror("malformed integer constant: %s", as)
- a.Val.SetUint64(0)
+ // The lexer checks for correct syntax of the literal
+ // and reports detailed errors. Thus SetString should
+ // never fail (in theory it might run out of memory,
+ // but that wouldn't be reported as an error here).
+ Fatalf("malformed integer constant: %s", as)
return
}
if a.checkOverflow(0) {