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
ee2990e7
Commit
ee2990e7
authored
Mar 02, 1997
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(process_init_element): Warn and truncate if upper bound of index is
out of range. From-SVN: r13684
parent
f28c0e69
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
gcc/c-typeck.c
+18
-8
No files found.
gcc/c-typeck.c
View file @
ee2990e7
...
...
@@ -5769,10 +5769,8 @@ set_init_index (first, last)
error_init
(
"duplicate array index in initializer%s"
,
" for `%s'"
,
NULL
);
else
{
TREE_INT_CST_LOW
(
constructor_index
)
=
TREE_INT_CST_LOW
(
first
);
TREE_INT_CST_HIGH
(
constructor_index
)
=
TREE_INT_CST_HIGH
(
first
);
TREE_INT_CST_LOW
(
constructor_index
)
=
TREE_INT_CST_LOW
(
first
);
TREE_INT_CST_HIGH
(
constructor_index
)
=
TREE_INT_CST_HIGH
(
first
);
if
(
last
!=
0
&&
tree_int_cst_lt
(
last
,
first
))
error_init
(
"empty index range in initializer%s"
,
" for `%s'"
,
NULL
);
...
...
@@ -6377,7 +6375,21 @@ process_init_element (value)
/* In the case of [LO .. HI] = VALUE, only evaluate VALUE once. */
if
(
constructor_range_end
)
{
if
(
constructor_max_index
!=
0
&&
tree_int_cst_lt
(
constructor_max_index
,
constructor_range_end
))
{
pedwarn_init
(
"excess elements in array initializer%s"
,
" after `%s'"
,
NULL_PTR
);
TREE_INT_CST_HIGH
(
constructor_range_end
)
=
TREE_INT_CST_HIGH
(
constructor_max_index
);
TREE_INT_CST_LOW
(
constructor_range_end
)
=
TREE_INT_CST_LOW
(
constructor_max_index
);
}
value
=
save_expr
(
value
);
}
/* Now output the actual element.
Ordinarily, output once.
...
...
@@ -6395,10 +6407,8 @@ process_init_element (value)
tem
=
size_binop
(
PLUS_EXPR
,
constructor_index
,
integer_one_node
);
TREE_INT_CST_LOW
(
constructor_index
)
=
TREE_INT_CST_LOW
(
tem
);
TREE_INT_CST_HIGH
(
constructor_index
)
=
TREE_INT_CST_HIGH
(
tem
);
TREE_INT_CST_LOW
(
constructor_index
)
=
TREE_INT_CST_LOW
(
tem
);
TREE_INT_CST_HIGH
(
constructor_index
)
=
TREE_INT_CST_HIGH
(
tem
);
if
(
!
value
)
/* If we are doing the bookkeeping for an element that was
...
...
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