- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 93 for slice (0.1 sec)
-
src/cmd/compile/internal/types2/index.go
if x.mode != variable { check.errorf(x, NonSliceableOperand, invalidOp+"%s (slice of unaddressable value)", x) x.mode = invalid return } x.typ = &Slice{elem: u.elem} case *Pointer: if u, _ := under(u.base).(*Array); u != nil { valid = true length = u.len x.typ = &Slice{elem: u.elem} } case *Slice: valid = true // x.typ doesn't change } if !valid {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Sep 15 16:16:58 UTC 2023 - 11.5K bytes - Viewed (0) -
src/cmd/compile/internal/walk/walk.go
} func walkAppendArgs(n *ir.CallExpr, init *ir.Nodes) { walkExprListSafe(n.Args, init) // walkExprListSafe will leave OINDEX (s[n]) alone if both s // and n are name or literal, but those may index the slice we're // modifying here. Fix explicitly. ls := n.Args for i1, n1 := range ls { ls[i1] = cheapExpr(n1, init) } } // appendWalkStmt typechecks and walks stmt and then appends it to init.
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Feb 27 20:56:00 UTC 2024 - 10.4K bytes - Viewed (0) -
src/cmd/compile/internal/typecheck/func.go
if !n.X.Type().IsSlice() && !n.Y.Type().IsSlice() { base.Errorf("arguments to copy must be slices; have %L, %L", n.X.Type(), n.Y.Type()) } else if !n.X.Type().IsSlice() { base.Errorf("first argument to copy should be slice; have %L", n.X.Type()) } else { base.Errorf("second argument to copy should be slice or string; have %L", n.Y.Type()) } n.SetType(nil) return n }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed Mar 06 15:23:18 UTC 2024 - 21.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/builtins.go
} case _SliceData: // unsafe.SliceData(slice []T) *T check.verifyVersionf(call.Fun, go1_20, "unsafe.SliceData") slice, _ := coreType(x.typ).(*Slice) if slice == nil { check.errorf(x, InvalidUnsafeSliceData, invalidArg+"%s is not a slice", x) return } x.mode = value x.typ = NewPointer(slice.elem) if check.recordTypes() {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 19:19:55 UTC 2024 - 27.1K bytes - Viewed (0) -
src/cmd/compile/internal/types2/subst.go
} case *Array: elem := subst.typOrNil(t.elem) if elem != t.elem { return &Array{len: t.len, elem: elem} } case *Slice: elem := subst.typOrNil(t.elem) if elem != t.elem { return &Slice{elem: elem} } case *Struct: if fields, copied := subst.varList(t.fields); copied { s := &Struct{fields: fields, tags: t.tags} s.markComplete() return s
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 03:04:07 UTC 2024 - 11K bytes - Viewed (0) -
src/cmd/compile/internal/walk/builtin.go
nif.Likely = true // then { s = s[:n] } slice := ir.NewSliceExpr(base.Pos, ir.OSLICE, s, nil, newLen, nil) slice.SetBounded(true) nif.Body = []ir.Node{ ir.NewAssignStmt(base.Pos, s, slice), } // else { s = growslice(s.ptr, n, s.cap, a, T) } nif.Else = []ir.Node{
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 22:35:22 UTC 2024 - 31.2K bytes - Viewed (0) -
src/cmd/compile/internal/ssa/nilcheck.go
// We also assume unsafe pointer arithmetic generates non-nil pointers. See #27180. // We assume that SlicePtr is non-nil because we do a bounds check // before the slice access (and all cap>0 slices have a non-nil ptr). See #30366. if v.Op == OpAddr || v.Op == OpLocalAddr || v.Op == OpAddPtr || v.Op == OpOffPtr || v.Op == OpAdd32 || v.Op == OpAdd64 || v.Op == OpSub32 || v.Op == OpSub64 || v.Op == OpSlicePtr {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Oct 31 20:45:54 UTC 2023 - 11.3K bytes - Viewed (0) -
src/cmd/compile/internal/types2/initorder.go
type graphNode struct { obj dependency // object represented by this node pred, succ nodeSet // consumers and dependencies of this node (lazily initialized) index int // node index in graph slice/priority queue ndeps int // number of outstanding dependencies before this object can be initialized } // cost returns the cost of removing this node, which involves copying each
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Mar 28 22:06:51 UTC 2024 - 9.8K bytes - Viewed (0) -
src/cmd/compile/internal/walk/order.go
[]ir.Node{ir.NewAssignOpStmt(base.Pos, ir.OADD, counter, ir.NewInt(base.Pos, 1))})) } // orderBlock orders the block of statements in n into a new slice, // and then replaces the old slice in n with the new slice. // free is a map that can be used to obtain temporary variables by type. func orderBlock(n *ir.Nodes, free map[string][]*ir.Name) { if len(*n) != 0 {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri Mar 08 02:00:33 UTC 2024 - 42.7K bytes - Viewed (0) -
src/bufio/bufio.go
b.w = 0 n, b.err = b.rd.Read(b.buf) if n < 0 { panic(errNegativeRead) } if n == 0 { return 0, b.readErr() } b.w += n } // copy as much as we can // Note: if the slice panics here, it is probably because // the underlying reader returned a bad count. See issue 49795. n = copy(p, b.buf[b.r:b.w]) b.r += n b.lastByte = int(b.buf[b.r-1]) b.lastRuneSize = -1 return n, nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu Oct 12 14:39:08 UTC 2023 - 21.8K bytes - Viewed (0)