Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
ca017169
Commit
ca017169
authored
Jul 27, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix build - broke with uint32 -> int change in reflect SliceHeader
TBR=r OCL=32225 CL=32225
parent
5aa17455
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
decode.go
src/pkg/gob/decode.go
+2
-2
value.go
src/pkg/reflect/value.go
+5
-5
No files found.
src/pkg/gob/decode.go
View file @
ca017169
...
...
@@ -446,8 +446,8 @@ func decodeSlice(atyp *reflect.SliceType, state *decodeState, p uintptr, elemOp
// Always write a header at p.
hdrp
:=
(
*
reflect
.
SliceHeader
)(
unsafe
.
Pointer
(
p
));
hdrp
.
Data
=
uintptr
(
unsafe
.
Pointer
(
&
data
[
0
]));
hdrp
.
Len
=
uint32
(
length
);
hdrp
.
Cap
=
uint32
(
length
);
hdrp
.
Len
=
int
(
length
);
hdrp
.
Cap
=
int
(
length
);
return
decodeArrayHelper
(
state
,
hdrp
.
Data
,
elemOp
,
elemWid
,
int
(
length
),
elemIndir
);
}
...
...
src/pkg/reflect/value.go
View file @
ca017169
...
...
@@ -559,7 +559,7 @@ func (v *SliceValue) SetLen(n int) {
if
n
<
0
||
n
>
int
(
s
.
Cap
)
{
panicln
(
"SetLen"
,
n
,
"with capacity"
,
s
.
Cap
);
}
s
.
Len
=
uint32
(
n
)
;
s
.
Len
=
n
;
}
// Set assigns x to v.
...
...
@@ -581,8 +581,8 @@ func (v *SliceValue) Slice(beg, end int) *SliceValue {
typ
:=
v
.
typ
.
(
*
SliceType
);
s
:=
new
(
SliceHeader
);
s
.
Data
=
uintptr
(
v
.
addr
())
+
uintptr
(
beg
)
*
typ
.
Elem
()
.
Size
();
s
.
Len
=
uint32
(
end
-
beg
)
;
s
.
Cap
=
uint32
(
cap
-
beg
)
;
s
.
Len
=
end
-
beg
;
s
.
Cap
=
cap
-
beg
;
return
newValue
(
typ
,
addr
(
s
),
v
.
canSet
)
.
(
*
SliceValue
);
}
...
...
@@ -607,8 +607,8 @@ func MakeSlice(typ *SliceType, len, cap int) *SliceValue {
}
data
:=
make
([]
uint8
,
size
);
s
.
Data
=
uintptr
(
addr
(
&
data
[
0
]));
s
.
Len
=
uint32
(
len
)
;
s
.
Cap
=
uint32
(
cap
)
;
s
.
Len
=
len
;
s
.
Cap
=
cap
;
return
newValue
(
typ
,
addr
(
s
),
true
)
.
(
*
SliceValue
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment