File: bug46_infinite_loop.c

package info (click to toggle)
re2c 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 50,052 kB
  • sloc: cpp: 32,477; ml: 8,279; sh: 5,265; makefile: 968; haskell: 612; python: 428; ansic: 227; javascript: 111; java: 3
file content (55 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Generated by re2c */
#line 1 "bug46_infinite_loop.re"
// re2c $INPUT -o $OUTPUT 
#include <string.h>
#include <stdio.h>

int main(int argc, char** argv)
{
    char* YYCURSOR = argv[1];
    char* YYLIMIT  = YYCURSOR + strlen(YYCURSOR);
    #define YYFILL(n) do { } while(0)


#line 15 "bug46_infinite_loop.c"
{
	unsigned char yych;
#line 14 "bug46_infinite_loop.re"
	{ }
#line 20 "bug46_infinite_loop.c"
}
#line 15 "bug46_infinite_loop.re"


/* BUG BEGINS HERE */

#line 27 "bug46_infinite_loop.c"
{
	unsigned char yych;
	goto yy1;
yy2:
	++YYCURSOR;
yy1:
	if (YYLIMIT <= YYCURSOR) YYFILL(1);
	yych = *YYCURSOR;
	switch (yych) {
		case 'a': goto yy4;
		case 'b':
		case 'c': goto yy3;
		default: goto yy2;
	}
yy3:
#line 19 "bug46_infinite_loop.re"
	{ printf("exit 0\n"); return 0; }
#line 45 "bug46_infinite_loop.c"
yy4:
	++YYCURSOR;
	goto yy3;
}
#line 20 "bug46_infinite_loop.re"


    printf("exit 1\n");
    return 0;
}
bug46_infinite_loop.re:19:13: warning: rule matches empty string [-Wmatch-empty-string]