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
93c8d3c4
Commit
93c8d3c4
authored
Nov 19, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
another shift bug
R=r OCL=19525 CL=19525
parent
92a4fe1d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
gen.c
src/cmd/6g/gen.c
+12
-7
No files found.
src/cmd/6g/gen.c
View file @
93c8d3c4
...
...
@@ -6,7 +6,6 @@
#undef EXTERN
#define EXTERN
#include "gg.h"
//#include "opt.h"
enum
{
...
...
@@ -93,11 +92,6 @@ if(throwreturn == N) {
gclean
();
checklabels
();
// if(debug['N']) {
// regopt(ptxt);
// debug['N'] = 0;
// }
if
(
curfn
->
type
->
outtuple
!=
0
)
{
gins
(
ACALL
,
N
,
throwreturn
);
}
...
...
@@ -105,6 +99,11 @@ if(throwreturn == N) {
pc
->
as
=
ARET
;
// overwrite AEND
pc
->
lineno
=
lineno
;
// if(debug['N']) {
// regopt(ptxt);
// debug['N'] = 0;
// }
// fill in argument size
ptxt
->
to
.
offset
=
rnd
(
curfn
->
type
->
argwid
,
maxround
);
...
...
@@ -1212,7 +1211,13 @@ cgen_shift(int op, Node *nl, Node *nr, Node *res)
if
(
nr
->
op
==
OLITERAL
)
{
regalloc
(
&
n1
,
nl
->
type
,
res
);
cgen
(
nl
,
&
n1
);
gins
(
a
,
nr
,
&
n1
);
if
(
mpgetfix
(
nr
->
val
.
u
.
xval
)
>=
nl
->
type
->
width
*
8
)
{
// large shift gets 2 shifts by width
nodconst
(
&
n3
,
types
[
TUINT32
],
nl
->
type
->
width
*
8
-
1
);
gins
(
a
,
&
n3
,
&
n1
);
gins
(
a
,
&
n3
,
&
n1
);
}
else
gins
(
a
,
nr
,
&
n1
);
gmove
(
&
n1
,
res
);
regfree
(
&
n1
);
goto
ret
;
...
...
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