Skip to content

Commit 475a7bc

Browse files
authored
Merge pull request #4285 from b4n/ada-is-crash
ada: Fix crash with `is` at EOF
2 parents ded185b + 33d1d1b commit 475a7bc

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--sort=no
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Seg_Fault_Example input.ada /^procedure Seg_Fault_Example is$/;" r
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
with Ada.Text_IO;
2+
3+
procedure Seg_Fault_Example is
4+

parsers/ada.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1173,7 +1173,7 @@ static adaTokenInfo *adaParseSubprogram (adaTokenInfo *parent, adaKind kind)
11731173
/* if this is a "new" something then no need to parse */
11741174
skipPast (";");
11751175
}
1176-
else if (line[pos] == '(')
1176+
else if (!eof_reached && line[pos] == '(')
11771177
{
11781178
/* '(' is the starter of an expression function. */
11791179
skipPast (";");

0 commit comments

Comments
 (0)