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
c29f4e00
Commit
c29f4e00
authored
Sep 21, 2012
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/gc: fix a spurious -u compile error
Fixes #4082. R=dsymonds CC=golang-dev
https://golang.org/cl/6545055
parent
f934bb8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
3 deletions
+6
-3
src/cmd/gc/go.h
src/cmd/gc/go.h
+1
-0
src/cmd/gc/reflect.c
src/cmd/gc/reflect.c
+4
-0
src/cmd/gc/typecheck.c
src/cmd/gc/typecheck.c
+1
-3
No files found.
src/cmd/gc/go.h
View file @
c29f4e00
...
...
@@ -919,6 +919,7 @@ EXTERN int32 thunk;
EXTERN
int
funcdepth
;
EXTERN
int
typecheckok
;
EXTERN
int
compiling_runtime
;
EXTERN
int
compiling_wrappers
;
/*
* y.tab.c
...
...
src/cmd/gc/reflect.c
View file @
c29f4e00
...
...
@@ -210,22 +210,26 @@ methods(Type *t)
// but we can generate more efficient code
// using genembedtramp if all that is necessary
// is a pointer adjustment and a JMP.
compiling_wrappers
=
1
;
if
(
isptr
[
it
->
etype
]
&&
isptr
[
this
->
etype
]
&&
f
->
embedded
&&
!
isifacemethod
(
f
->
type
))
genembedtramp
(
it
,
f
,
a
->
isym
,
1
);
else
genwrapper
(
it
,
f
,
a
->
isym
,
1
);
compiling_wrappers
=
0
;
}
}
if
(
!
(
a
->
tsym
->
flags
&
SymSiggen
))
{
a
->
tsym
->
flags
|=
SymSiggen
;
if
(
!
eqtype
(
this
,
t
))
{
compiling_wrappers
=
1
;
if
(
isptr
[
t
->
etype
]
&&
isptr
[
this
->
etype
]
&&
f
->
embedded
&&
!
isifacemethod
(
f
->
type
))
genembedtramp
(
t
,
f
,
a
->
tsym
,
0
);
else
genwrapper
(
t
,
f
,
a
->
tsym
,
0
);
compiling_wrappers
=
0
;
}
}
}
...
...
src/cmd/gc/typecheck.c
View file @
c29f4e00
...
...
@@ -1536,9 +1536,7 @@ ret:
}
}
// TODO(rsc): should not need to check importpkg,
// but reflect mentions unsafe.Pointer.
if
(
safemode
&&
!
incannedimport
&&
!
importpkg
&&
t
&&
t
->
etype
==
TUNSAFEPTR
)
if
(
safemode
&&
!
incannedimport
&&
!
importpkg
&&
!
compiling_wrappers
&&
t
&&
t
->
etype
==
TUNSAFEPTR
)
yyerror
(
"cannot use unsafe.Pointer"
);
evconst
(
n
);
...
...
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