Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Commit c55b04f

Browse files
committed
fix data model for several tasks.
All those tasks were preprocessed for 64bit and have missing original sources. This commit adds the extracted original sources (.c files) and applies proper preprocessing for 32bit data model. I guesses the required header files according to the called functions.
1 parent 7ba4497 commit c55b04f

File tree

12 files changed

+3200
-6139
lines changed

12 files changed

+3200
-6139
lines changed

c/ldv-regression/alt_test.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
extern void abort(void);
2+
extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
3+
void reach_error() { __assert_fail("0", "alt_test.i", 3, "reach_error"); }
4+
5+
#include <stdlib.h>
6+
7+
void __blast_assert()
8+
{
9+
ERROR: {reach_error();abort();}
10+
}
11+
12+
int globalState = 0;
13+
void* l_malloc(int);
14+
void l_free(void*);
15+
16+
int
17+
main(int argc, char* argv[]) {
18+
int *a = (int*) l_malloc(sizeof(int));
19+
l_free(a);
20+
l_free(a);
21+
return 0;
22+
}
23+
24+
void* l_malloc(int size) {
25+
void *retVal = malloc(size);
26+
if(retVal != ((void *)0))
27+
globalState=1;
28+
return retVal;
29+
}
30+
31+
void l_free(void* ptr) {
32+
if(ptr!=((void *)0)) ((globalState == 1) ? (0) : __blast_assert ());
33+
globalState = 0;
34+
free(ptr);
35+
}

0 commit comments

Comments
 (0)