mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Limit constants to within ±(1 << 1000)
This commit is contained in:
1 parent
ae41c7ceb5
commit
8ce26e4025
1 file changed
+4
-2
@@ -51,6 +51,9 @@ var (
|
|||||||
oneTwentyEight = big.NewInt(+128)
|
oneTwentyEight = big.NewInt(+128)
|
||||||
ffff = big.NewInt(0xFFFF)
|
ffff = big.NewInt(0xFFFF)
|
||||||
|
|
||||||
|
minIdeal = big.NewInt(0).Lsh(minusOne, 1000)
|
||||||
|
maxIdeal = big.NewInt(0).Lsh(one, 1000)
|
||||||
|
|
||||||
maxIntBits = big.NewInt(t.MaxIntBits)
|
maxIntBits = big.NewInt(t.MaxIntBits)
|
||||||
|
|
||||||
zeroExpr = a.NewExpr(0, 0, 0, t.ID0, nil, nil, nil, nil)
|
zeroExpr = a.NewExpr(0, 0, 0, t.ID0, nil, nil, nil, nil)
|
||||||
@@ -1315,8 +1318,7 @@ func (q *checker) bcheckExprAssociativeOp(n *a.Expr, depth uint32) (a.Bounds, er
|
|||||||
|
|
||||||
func (q *checker) bcheckTypeExpr(typ *a.TypeExpr) (a.Bounds, error) {
|
func (q *checker) bcheckTypeExpr(typ *a.TypeExpr) (a.Bounds, error) {
|
||||||
if typ.IsIdeal() {
|
if typ.IsIdeal() {
|
||||||
// TODO: can an ideal type be refined??
|
return a.Bounds{minIdeal, maxIdeal}, nil
|
||||||
return a.Bounds{}, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch typ.Decorator() {
|
switch typ.Decorator() {
|
||||||
|
|||||||
Reference in new issue
Block a user