Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
84c67c3b
Commit
84c67c3b
authored
Oct 02, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runtime: Fix append of slice with elements of zero size.
From-SVN: r203140
parent
11b54a5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
libgo/runtime/go-append.c
+6
-6
No files found.
libgo/runtime/go-append.c
View file @
84c67c3b
...
...
@@ -24,24 +24,24 @@ __go_append (struct __go_open_array a, void *bvalues, uintptr_t bcount,
uintptr_t
element_size
)
{
uintptr_t
ucount
;
int
count
;
int
go
count
;
if
(
bvalues
==
NULL
||
bcount
==
0
)
return
a
;
ucount
=
(
uintptr_t
)
a
.
__count
+
bcount
;
count
=
(
int
)
ucount
;
count
=
(
int
go
)
ucount
;
if
((
uintptr_t
)
count
!=
ucount
||
count
<=
a
.
__count
)
runtime_panicstring
(
"append: slice overflow"
);
if
(
count
>
a
.
__capacity
)
{
int
m
;
int
go
m
;
void
*
n
;
m
=
a
.
__capacity
;
if
(
m
==
0
)
m
=
(
int
)
b
count
;
if
(
m
+
m
<
count
)
m
=
count
;
else
{
do
...
...
@@ -54,7 +54,7 @@ __go_append (struct __go_open_array a, void *bvalues, uintptr_t bcount,
while
(
m
<
count
);
}
if
((
uintptr
)
m
>
MaxMem
/
element_size
)
if
(
element_size
>
0
&&
(
uintptr
)
m
>
MaxMem
/
element_size
)
runtime_panicstring
(
"growslice: cap out of range"
);
n
=
__go_alloc
(
m
*
element_size
);
...
...
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