Commit 2ac3624b by Paul Eggert

(label): Use `convert_and_check' when checking for

overflow in case labels.

From-SVN: r4824
parent 9f8373c3
...@@ -1853,7 +1853,8 @@ label: CASE expr_no_commas ':' ...@@ -1853,7 +1853,8 @@ label: CASE expr_no_commas ':'
if (value != error_mark_node) if (value != error_mark_node)
{ {
tree duplicate; tree duplicate;
int success = pushcase (value, label, &duplicate); int success = pushcase (value, convert_and_check,
label, &duplicate);
if (success == 1) if (success == 1)
error ("case label not within a switch statement"); error ("case label not within a switch statement");
else if (success == 2) else if (success == 2)
...@@ -1878,7 +1879,8 @@ label: CASE expr_no_commas ':' ...@@ -1878,7 +1879,8 @@ label: CASE expr_no_commas ':'
if (value1 != error_mark_node && value2 != error_mark_node) if (value1 != error_mark_node && value2 != error_mark_node)
{ {
tree duplicate; tree duplicate;
int success = pushcase_range (value1, value2, label, int success = pushcase_range (value1, value2,
convert_and_check, label,
&duplicate); &duplicate);
if (success == 1) if (success == 1)
error ("case label not within a switch statement"); error ("case label not within a switch statement");
...@@ -1900,7 +1902,7 @@ label: CASE expr_no_commas ':' ...@@ -1900,7 +1902,7 @@ label: CASE expr_no_commas ':'
tree duplicate; tree duplicate;
register tree label register tree label
= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE); = build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
int success = pushcase (NULL_TREE, label, &duplicate); int success = pushcase (NULL_TREE, 0, label, &duplicate);
stmt_count++; stmt_count++;
if (success == 1) if (success == 1)
error ("default label not within a switch statement"); error ("default label not within a switch statement");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment