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
10d14b63
Commit
10d14b63
authored
Dec 09, 2012
by
Rémy Oudompheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/gc: prevent ngotype from allocating.
R=golang-dev, dave, rsc CC=golang-dev
https://golang.org/cl/6904061
parent
45fe306a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
go.h
src/cmd/gc/go.h
+1
-0
reflect.c
src/cmd/gc/reflect.c
+11
-2
subr.c
src/cmd/gc/subr.c
+1
-1
No files found.
src/cmd/gc/go.h
View file @
10d14b63
...
...
@@ -1211,6 +1211,7 @@ void dumptypestructs(void);
Type
*
methodfunc
(
Type
*
f
,
Type
*
);
Node
*
typename
(
Type
*
t
);
Sym
*
typesym
(
Type
*
t
);
Sym
*
typenamesym
(
Type
*
t
);
Sym
*
tracksym
(
Type
*
t
);
Sym
*
typesymprefix
(
char
*
prefix
,
Type
*
t
);
int
haspointers
(
Type
*
t
);
...
...
src/cmd/gc/reflect.c
View file @
10d14b63
...
...
@@ -652,8 +652,8 @@ typesymprefix(char *prefix, Type *t)
return
s
;
}
Node
*
typename
(
Type
*
t
)
Sym
*
typename
sym
(
Type
*
t
)
{
Sym
*
s
;
Node
*
n
;
...
...
@@ -674,7 +674,16 @@ typename(Type *t)
signatlist
=
list
(
signatlist
,
typenod
(
t
));
}
return
s
->
def
->
sym
;
}
Node
*
typename
(
Type
*
t
)
{
Sym
*
s
;
Node
*
n
;
s
=
typenamesym
(
t
);
n
=
nod
(
OADDR
,
s
->
def
,
N
);
n
->
type
=
ptrto
(
s
->
def
->
type
);
n
->
addable
=
1
;
...
...
src/cmd/gc/subr.c
View file @
10d14b63
...
...
@@ -3517,7 +3517,7 @@ ngotype(Node *n)
{
if
(
n
->
sym
!=
S
&&
n
->
realtype
!=
T
)
if
(
strncmp
(
n
->
sym
->
name
,
"autotmp_"
,
8
)
!=
0
)
return
typename
(
n
->
realtype
)
->
left
->
sym
;
return
typename
sym
(
n
->
realtype
)
;
return
S
;
}
...
...
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