Skip to content

Commit ca8c1a9

Browse files
author
Daniel Kroening
authored
Merge pull request #5283 from danpoe/tests/pointer-overflow
Regression tests demonstrating spurious pointer overflow check failure
2 parents 7e27cb2 + 0c8aedd commit ca8c1a9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#include <stdlib.h>
2+
3+
void main()
4+
{
5+
char *p = (char *)10;
6+
p -= 1;
7+
p += 1;
8+
p += -1; // spurious pointer overflow report
9+
p -= -1; // spurious pointer overflow report
10+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.c
3+
--pointer-overflow-check
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
\[main.overflow.1\] line \d+ pointer arithmetic overflow on - in p - \(signed long int\)1: SUCCESS
7+
\[main.overflow.2\] line \d+ pointer arithmetic overflow on \+ in p \+ \(signed long int\)1: SUCCESS
8+
\[main.overflow.3\] line \d+ pointer arithmetic overflow on \+ in p \+ \(signed long int\)-1: SUCCESS
9+
\[main.overflow.4\] line \d+ pointer arithmetic overflow on - in p - \(signed long int\)-1: SUCCESS
10+
--
11+
^warning: ignoring

0 commit comments

Comments
 (0)