Skip to content

Commit

Permalink
Ada: Fix code generated for minint and maxint
Browse files Browse the repository at this point in the history
We were generating code using MININT and MAXINT, which don't exist in
Ada.  We now use Integer'First and Integer'Last.
  • Loading branch information
ojwb committed Oct 21, 2021
1 parent e6d8b6f commit 55fd44b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/generator_ada.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,9 @@ static void generate_AE(struct generator * g, struct node * p) {
write_char(g, ')');
break;
case c_maxint:
write_string(g, "MAXINT"); break;
write_string(g, "Integer'Last"); break;
case c_minint:
write_string(g, "MININT"); break;
write_string(g, "Integer'First"); break;
case c_neg:
write_string(g, "(-"); generate_AE(g, p->right); write_char(g, ')'); break;
case c_multiply:
Expand Down

0 comments on commit 55fd44b

Please sign in to comment.