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
0f0ff6ec
Commit
0f0ff6ec
authored
Jan 23, 2003
by
Tom Tromey
Committed by
Tom Tromey
Jan 23, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* constants.c (set_constant_entry): Allocated cleared memory.
From-SVN: r61661
parent
9a600d0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
gcc/java/ChangeLog
+4
-0
gcc/java/constants.c
+9
-2
No files found.
gcc/java/ChangeLog
View file @
0f0ff6ec
2003-01-23 Tom Tromey <tromey@redhat.com>
* constants.c (set_constant_entry): Allocated cleared memory.
2003-01-22 Tom Tromey <tromey@redhat.com>
* java-tree.h: Don't use PARAMS.
...
...
gcc/java/constants.c
View file @
0f0ff6ec
...
...
@@ -46,12 +46,14 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
if
(
cpool
->
data
==
NULL
)
{
cpool
->
capacity
=
100
;
cpool
->
tags
=
ggc_alloc
(
sizeof
(
uint8
)
*
cpool
->
capacity
);
cpool
->
data
=
ggc_alloc
(
sizeof
(
union
cpool_entry
)
*
cpool
->
capacity
);
cpool
->
tags
=
ggc_alloc_cleared
(
sizeof
(
uint8
)
*
cpool
->
capacity
);
cpool
->
data
=
ggc_alloc_cleared
(
sizeof
(
union
cpool_entry
)
*
cpool
->
capacity
);
cpool
->
count
=
1
;
}
if
(
index
>=
cpool
->
capacity
)
{
int
old_cap
=
cpool
->
capacity
;
cpool
->
capacity
*=
2
;
if
(
index
>=
cpool
->
capacity
)
cpool
->
capacity
=
index
+
10
;
...
...
@@ -59,6 +61,11 @@ set_constant_entry (CPool *cpool, int index, int tag, jword value)
sizeof
(
uint8
)
*
cpool
->
capacity
);
cpool
->
data
=
ggc_realloc
(
cpool
->
data
,
sizeof
(
union
cpool_entry
)
*
cpool
->
capacity
);
/* Make sure GC never sees uninitialized tag values. */
memset
(
cpool
->
tags
+
old_cap
,
0
,
cpool
->
capacity
-
old_cap
);
memset
(
cpool
->
data
+
old_cap
,
0
,
(
cpool
->
capacity
-
old_cap
)
*
sizeof
(
union
cpool_entry
));
}
if
(
index
>=
cpool
->
count
)
cpool
->
count
=
index
+
1
;
...
...
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