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
b365495a
Commit
b365495a
authored
Apr 09, 2011
by
Duncan Sands
Committed by
Duncan Sands
Apr 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bail out rather than crashing in array_type_nelts if TYPE_MAX_VALUE is null.
From-SVN: r172227
parent
273a32b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
gcc/ChangeLog
+4
-0
gcc/tree.c
+4
-0
No files found.
gcc/ChangeLog
View file @
b365495a
2011-04-09 Duncan Sands <baldrick@free.fr>
* tree.c (array_type_nelts): Bail out if TYPE_MAX_VALUE not set.
2011-04-08 Eric Botcazou <ebotcazou@adacore.com>
2011-04-08 Eric Botcazou <ebotcazou@adacore.com>
* combine.c (combine_validate_cost): Adjust comments. Set registered
* combine.c (combine_validate_cost): Adjust comments. Set registered
...
...
gcc/tree.c
View file @
b365495a
...
@@ -2462,6 +2462,10 @@ array_type_nelts (const_tree type)
...
@@ -2462,6 +2462,10 @@ array_type_nelts (const_tree type)
min
=
TYPE_MIN_VALUE
(
index_type
);
min
=
TYPE_MIN_VALUE
(
index_type
);
max
=
TYPE_MAX_VALUE
(
index_type
);
max
=
TYPE_MAX_VALUE
(
index_type
);
/* TYPE_MAX_VALUE may not be set if the array has unknown length. */
if
(
!
max
)
return
error_mark_node
;
return
(
integer_zerop
(
min
)
return
(
integer_zerop
(
min
)
?
max
?
max
:
fold_build2
(
MINUS_EXPR
,
TREE_TYPE
(
max
),
max
,
min
));
:
fold_build2
(
MINUS_EXPR
,
TREE_TYPE
(
max
),
max
,
min
));
...
...
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