aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/typecheck/expr.go5
-rw-r--r--src/cmd/compile/internal/typecheck/func.go14
2 files changed, 0 insertions, 19 deletions
diff --git a/src/cmd/compile/internal/typecheck/expr.go b/src/cmd/compile/internal/typecheck/expr.go
index 7dc29636cc..53c291291f 100644
--- a/src/cmd/compile/internal/typecheck/expr.go
+++ b/src/cmd/compile/internal/typecheck/expr.go
@@ -6,7 +6,6 @@ package typecheck
import (
"fmt"
- "go/constant"
"internal/types/errors"
"strings"
@@ -846,10 +845,6 @@ func tcStringHeader(n *ir.StringHeaderExpr) ir.Node {
n.Ptr = Expr(n.Ptr)
n.Len = DefaultLit(Expr(n.Len), types.Types[types.TINT])
- if ir.IsConst(n.Len, constant.Int) && ir.Int64Val(n.Len) < 0 {
- base.Fatalf("len for OSTRINGHEADER must be non-negative")
- }
-
return n
}
diff --git a/src/cmd/compile/internal/typecheck/func.go b/src/cmd/compile/internal/typecheck/func.go
index 5765731546..79093e5194 100644
--- a/src/cmd/compile/internal/typecheck/func.go
+++ b/src/cmd/compile/internal/typecheck/func.go
@@ -12,7 +12,6 @@ import (
"fmt"
"go/constant"
- "go/token"
)
// MakeDotArgs package all the arguments that match a ... T parameter into a []T.
@@ -564,11 +563,6 @@ func tcMake(n *ir.CallExpr) ir.Node {
n.SetType(nil)
return n
}
- if ir.IsConst(l, constant.Int) && r != nil && ir.IsConst(r, constant.Int) && constant.Compare(l.Val(), token.GTR, r.Val()) {
- base.Errorf("len larger than cap in make(%v)", t)
- n.SetType(nil)
- return n
- }
nn = ir.NewMakeExpr(n.Pos(), ir.OMAKESLICE, l, r)
case types.TMAP:
@@ -655,14 +649,6 @@ func tcMakeSliceCopy(n *ir.MakeExpr) ir.Node {
base.Errorf("non-integer len argument in OMAKESLICECOPY")
}
- if ir.IsConst(n.Len, constant.Int) {
- if ir.ConstOverflow(n.Len.Val(), types.Types[types.TINT]) {
- base.Fatalf("len for OMAKESLICECOPY too large")
- }
- if constant.Sign(n.Len.Val()) < 0 {
- base.Fatalf("len for OMAKESLICECOPY must be non-negative")
- }
- }
return n
}