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
84b5706a
Commit
84b5706a
authored
Sep 13, 2018
by
Bernd Edlinger
Committed by
Jeff Law
Sep 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fold-const.c (c_getstr): Clamp STRING_LENGTH to STRING_SIZE.
From-SVN: r264293
parent
5ec9f8cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
gcc/ChangeLog
+2
-0
gcc/fold-const.c
+4
-0
No files found.
gcc/ChangeLog
View file @
84b5706a
2018-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
2018-09-13 Bernd Edlinger <bernd.edlinger@hotmail.de>
* fold-const.c (c_getstr): Clamp STRING_LENGTH to STRING_SIZE.
* varasm.c (compare_constant): Compare type size of STRING_CSTs.
* varasm.c (compare_constant): Compare type size of STRING_CSTs.
(get_constant_size): Don't make STRING_CSTs larger than they are.
(get_constant_size): Don't make STRING_CSTs larger than they are.
(check_string_literal): New check function for STRING_CSTs.
(check_string_literal): New check function for STRING_CSTs.
...
...
gcc/fold-const.c
View file @
84b5706a
...
@@ -14611,6 +14611,10 @@ c_getstr (tree src, unsigned HOST_WIDE_INT *strlen /* = NULL */,
...
@@ -14611,6 +14611,10 @@ c_getstr (tree src, unsigned HOST_WIDE_INT *strlen /* = NULL */,
const
char
*
string
=
TREE_STRING_POINTER
(
src
);
const
char
*
string
=
TREE_STRING_POINTER
(
src
);
/* Ideally this would turn into a gcc_checking_assert over time. */
if
(
string_length
>
string_size
)
string_length
=
string_size
;
if
(
string_length
==
0
if
(
string_length
==
0
||
offset
>=
string_size
)
||
offset
>=
string_size
)
return
NULL
;
return
NULL
;
...
...
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