Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
a3ce4803
Commit
a3ce4803
authored
Nov 19, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reflect: Fix invalid sharing in valueInterface.
From-SVN: r193614
parent
822a258a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
libgo/go/reflect/value.go
+4
-4
No files found.
libgo/go/reflect/value.go
View file @
a3ce4803
...
@@ -342,7 +342,7 @@ func (v Value) Call(in []Value) []Value {
...
@@ -342,7 +342,7 @@ func (v Value) Call(in []Value) []Value {
}
}
// CallSlice calls the variadic function v with the input arguments in,
// CallSlice calls the variadic function v with the input arguments in,
// assigning the slice in[len(in)-1] to v's final variadic argument.
// assigning the slice in[len(in)-1] to v's final variadic argument.
// For example, if len(in) == 3, v.Call(in) represents the Go call v(in[0], in[1], in[2]...).
// For example, if len(in) == 3, v.Call(in) represents the Go call v(in[0], in[1], in[2]...).
// Call panics if v's Kind is not Func or if v is not variadic.
// Call panics if v's Kind is not Func or if v is not variadic.
// It returns the output results as Values.
// It returns the output results as Values.
...
@@ -905,7 +905,7 @@ func valueInterface(v Value, safe bool) interface{} {
...
@@ -905,7 +905,7 @@ func valueInterface(v Value, safe bool) interface{} {
if
safe
&&
v
.
flag
&
flagRO
!=
0
{
if
safe
&&
v
.
flag
&
flagRO
!=
0
{
// Do not allow access to unexported values via Interface,
// Do not allow access to unexported values via Interface,
// because they might be pointers that should not be
// because they might be pointers that should not be
// writable or methods or function that should not be callable.
// writable or methods or function that should not be callable.
panic
(
"reflect.Value.Interface: cannot return value obtained from unexported field or method"
)
panic
(
"reflect.Value.Interface: cannot return value obtained from unexported field or method"
)
}
}
...
@@ -928,7 +928,7 @@ func valueInterface(v Value, safe bool) interface{} {
...
@@ -928,7 +928,7 @@ func valueInterface(v Value, safe bool) interface{} {
eface
.
typ
=
v
.
typ
.
runtimeType
()
eface
.
typ
=
v
.
typ
.
runtimeType
()
eface
.
word
=
v
.
iword
()
eface
.
word
=
v
.
iword
()
if
v
.
flag
&
flagIndir
!=
0
&&
v
.
typ
.
size
>
ptrSize
{
if
v
.
flag
&
flagIndir
!=
0
&&
v
.
kind
()
!=
Ptr
&&
v
.
kind
()
!=
UnsafePointer
{
// eface.word is a pointer to the actual data,
// eface.word is a pointer to the actual data,
// which might be changed. We need to return
// which might be changed. We need to return
// a pointer to unchanging data, so make a copy.
// a pointer to unchanging data, so make a copy.
...
@@ -1777,7 +1777,7 @@ func Select(cases []SelectCase) (chosen int, recv Value, recvOK bool) {
...
@@ -1777,7 +1777,7 @@ func Select(cases []SelectCase) (chosen int, recv Value, recvOK bool) {
default
:
default
:
panic
(
"reflect.Select: invalid Dir"
)
panic
(
"reflect.Select: invalid Dir"
)
case
SelectDefault
:
// default
case
SelectDefault
:
// default
if
haveDefault
{
if
haveDefault
{
panic
(
"reflect.Select: multiple default cases"
)
panic
(
"reflect.Select: multiple default cases"
)
}
}
...
...
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