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
3908c16f
Commit
3908c16f
authored
Mar 29, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: bug265
Fixes #700. R=ken2 CC=golang-dev
https://golang.org/cl/839041
parent
b880543f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
8 deletions
+20
-8
src/cmd/gc/walk.c
src/cmd/gc/walk.c
+20
-5
test/fixedbugs/bug265.go
test/fixedbugs/bug265.go
+0
-0
test/golden.out
test/golden.out
+0
-3
No files found.
src/cmd/gc/walk.c
View file @
3908c16f
...
@@ -328,6 +328,23 @@ samelist(NodeList *a, NodeList *b)
...
@@ -328,6 +328,23 @@ samelist(NodeList *a, NodeList *b)
return
a
==
b
;
return
a
==
b
;
}
}
static
int
paramoutheap
(
Node
*
fn
)
{
NodeList
*
l
;
for
(
l
=
fn
->
dcl
;
l
;
l
=
l
->
next
)
{
switch
(
l
->
n
->
class
)
{
case
PPARAMOUT
|
PHEAP
:
return
1
;
case
PAUTO
:
case
PAUTO
|
PHEAP
:
// stop early - parameters are over
return
0
;
}
}
return
0
;
}
void
void
walkstmt
(
Node
**
np
)
walkstmt
(
Node
**
np
)
...
@@ -441,11 +458,9 @@ walkstmt(Node **np)
...
@@ -441,11 +458,9 @@ walkstmt(Node **np)
case
ORETURN
:
case
ORETURN
:
walkexprlist
(
n
->
list
,
&
n
->
ninit
);
walkexprlist
(
n
->
list
,
&
n
->
ninit
);
if
(
curfn
->
type
->
outnamed
&&
count
(
n
->
list
)
!=
1
)
{
if
(
n
->
list
==
nil
)
if
(
n
->
list
==
nil
)
{
// print("special return\n");
break
;
break
;
}
if
((
curfn
->
type
->
outnamed
&&
count
(
n
->
list
)
>
1
)
||
paramoutheap
(
curfn
))
{
// assign to the function out parameters,
// assign to the function out parameters,
// so that reorder3 can fix up conflicts
// so that reorder3 can fix up conflicts
rl
=
nil
;
rl
=
nil
;
...
...
test/bugs/bug265.go
→
test/
fixed
bugs/bug265.go
View file @
3908c16f
File moved
test/golden.out
View file @
3908c16f
...
@@ -192,6 +192,3 @@ bal
...
@@ -192,6 +192,3 @@ bal
barCount != 1
barCount != 1
panic PC=xxx
panic PC=xxx
BUG
BUG
=========== bugs/bug265.go
BUG
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