comparison gcc/testsuite/gcc.c-torture/compile/20090331-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
comparison
equal deleted inserted replaced
68:561a7518be6b 111:04ced10e8804
1 struct re_pattern_buffer {
2 unsigned char *buffer;
3 unsigned long int allocated;
4 };
5 void byte_regex_compile (struct re_pattern_buffer *bufp,
6 unsigned char *begalt, unsigned char *b)
7 {
8 unsigned char *pfrom;
9 unsigned char *pto;
10
11 while ((unsigned long) (b - bufp->buffer + 3) > bufp->allocated)
12 {
13 unsigned char *old_buffer = bufp->buffer;
14 bufp->allocated <<= 1;
15 if (old_buffer != bufp->buffer)
16 {
17 int incr = bufp->buffer - old_buffer;
18 b += incr;
19 }
20 }
21 pfrom = b;
22 pto = b + 3;
23 while (pfrom != begalt)
24 *--pto = *--pfrom;
25 }
26