Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for checksliceconst (0.19 sec)

  1. src/cmd/compile/internal/typecheck/expr.go

    		n.SetType(nil)
    		return n
    	}
    	if n.Max != nil && !checksliceindex(l, n.Max, tp) {
    		n.SetType(nil)
    		return n
    	}
    	if !checksliceconst(n.Low, n.High) || !checksliceconst(n.Low, n.Max) || !checksliceconst(n.High, n.Max) {
    		n.SetType(nil)
    		return n
    	}
    	return n
    }
    
    // tcSliceHeader typechecks an OSLICEHEADER node.
    func tcSliceHeader(n *ir.SliceHeaderExpr) ir.Node {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:29:45 UTC 2024
    - 23.1K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/typecheck/typecheck.go

    			return false
    		} else if ir.ConstOverflow(x, types.Types[types.TINT]) {
    			base.Errorf("invalid slice index %v (index too large)", r)
    			return false
    		}
    	}
    
    	return true
    }
    
    func checksliceconst(lo ir.Node, hi ir.Node) bool {
    	if lo != nil && hi != nil && lo.Op() == ir.OLITERAL && hi.Op() == ir.OLITERAL && constant.Compare(lo.Val(), token.GTR, hi.Val()) {
    		base.Errorf("invalid slice index: %v > %v", lo, hi)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 20 19:08:34 UTC 2024
    - 30.5K bytes
    - Viewed (0)
Back to top