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
c69d54e7
Commit
c69d54e7
authored
Mar 29, 2008
by
Ken Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug28
fix code generation bug in second index of string slice. SVN=114255
parent
0b62cb61
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
gen.c
src/c/gen.c
+9
-16
No files found.
src/c/gen.c
View file @
c69d54e7
...
...
@@ -245,7 +245,7 @@ void
cgen
(
Node
*
n
)
{
long
lno
;
Node
*
nl
,
*
nr
,
*
r
,
*
r1
;
Node
*
nl
,
*
nr
,
*
r
;
int
a
;
Prog
*
p1
,
*
p2
,
*
p3
;
...
...
@@ -358,21 +358,14 @@ cgen(Node *n)
break
;
case
OSLICE
:
nl
=
n
->
left
;
nl
=
n
->
left
;
// name
nr
=
n
->
right
;
r
=
nr
->
left
;
if
(
usesptr
(
nr
->
left
))
{
cgen
(
nr
->
left
);
r
=
tempname
(
nr
->
left
->
type
);
gopcodet
(
PSTORE
,
nr
->
left
->
type
,
r
);
}
r1
=
nr
->
right
;
if
(
!
nr
->
right
->
addable
)
{
cgen
(
nr
->
right
);
r1
=
tempname
(
nr
->
right
->
type
);
gopcodet
(
PSTORE
,
nr
->
right
->
type
,
r1
);
r
=
nr
->
right
;
// index2
if
(
!
r
->
addable
)
{
cgen
(
r
);
r
=
tempname
(
r
->
type
);
gopcodet
(
PSTORE
,
r
->
type
,
r
);
}
// string into PTADDR
...
...
@@ -385,8 +378,8 @@ cgen(Node *n)
// offset in int reg
cgen
(
nr
->
left
);
//
len
addressed
gopcodet
(
PSLICE
,
nr
->
left
->
type
,
nr
->
right
);
//
index 2
addressed
gopcodet
(
PSLICE
,
r
->
type
,
r
);
break
;
case
OINDEXPTR
:
...
...
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