Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
96db724c
Commit
96db724c
authored
Dec 13, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: emit reflect correct reflect types
Fixes #1169. R=ken2 CC=golang-dev
https://golang.org/cl/3595043
parent
c7c16175
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
25 deletions
+16
-25
src/cmd/gc/reflect.c
src/cmd/gc/reflect.c
+16
-25
No files found.
src/cmd/gc/reflect.c
View file @
96db724c
...
...
@@ -678,11 +678,10 @@ typename(Type *t)
static
Sym
*
dtypesym
(
Type
*
t
)
{
int
ot
,
n
,
isddd
;
int
ot
,
n
,
isddd
,
dupok
;
Sym
*
s
,
*
s1
,
*
s2
;
Sig
*
a
,
*
m
;
Type
*
t1
;
Sym
*
tsym
;
Type
*
t1
,
*
tbase
;
if
(
isideal
(
t
))
fatal
(
"dtypesym %T"
,
t
);
...
...
@@ -695,30 +694,22 @@ dtypesym(Type *t)
// special case (look for runtime below):
// when compiling package runtime,
// emit the type structures for int, float, etc.
t1
=
T
;
if
(
isptr
[
t
->
etype
])
t1
=
t
->
type
;
tsym
=
S
;
if
(
t1
)
tsym
=
t1
->
sym
;
else
tsym
=
t
->
sym
;
tbase
=
t
;
if
(
isptr
[
t
->
etype
]
&&
t
->
sym
==
S
&&
t
->
type
->
sym
!=
S
)
tbase
=
t
->
type
;
dupok
=
tbase
->
sym
==
S
;
if
(
compiling_runtime
)
{
if
(
t
==
types
[
t
->
etype
])
if
(
t
base
==
types
[
tbase
->
etype
])
// int, float, etc
goto
ok
;
if
(
t1
&&
t1
==
types
[
t1
->
etype
])
goto
ok
;
if
(
t1
&&
t1
->
etype
==
tptr
&&
t1
->
type
->
etype
==
TANY
)
if
(
tbase
->
etype
==
tptr
&&
tbase
->
type
->
etype
==
TANY
)
// unsafe.Pointer
goto
ok
;
}
// named types from other files are defined in those files
if
(
t
->
sym
&&
!
t
->
local
)
return
s
;
if
(
!
t
->
sym
&&
t1
&&
t1
->
sym
&&
!
t1
->
local
)
// named types from other files are defined only by those files
if
(
tbase
->
sym
&&
!
tbase
->
local
)
return
s
;
if
(
isforw
[
t
->
etype
]
||
(
t1
&&
isforw
[
t1
->
etype
])
)
if
(
isforw
[
t
base
->
etype
]
)
return
s
;
ok:
...
...
@@ -854,7 +845,7 @@ ok:
break
;
}
ggloblsym
(
s
,
ot
,
tsym
==
nil
);
ggloblsym
(
s
,
ot
,
dupok
);
return
s
;
}
...
...
@@ -882,7 +873,7 @@ dumptypestructs(void)
continue
;
t
=
n
->
type
;
dtypesym
(
t
);
if
(
t
->
sym
&&
!
isptr
[
t
->
etype
]
)
if
(
t
->
sym
)
dtypesym
(
ptrto
(
t
));
}
...
...
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