-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfakecontext.c
82 lines (77 loc) · 1.23 KB
/
fakecontext.c
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
struct savearea {
int a, b, c, d, e, f, g, h, i, j, k, l, m;
int n, o, p, q, r, s, t, u, v, w, x, y, z;
};
void startNewProc(void (*f)(), void *sp)
{
int x = (int)sp + 1;
f();
junk(x);
}
void returnToProc(struct savearea *ts)
{
int a, b, c, d, e, f, g, h, i, j, k, l, m;
int n, o, p, q, r, s, t, u, v, w, x, y, z;
a = ts->a;
b = ts->b;
c = ts->c;
d = ts->d;
e = ts->e;
f = ts->f;
g = ts->g;
h = ts->h;
i = ts->i;
j = ts->j;
k = ts->k;
l = ts->l;
m = ts->m;
n = ts->n;
o = ts->o;
p = ts->p;
q = ts->q;
r = ts->r;
s = ts->s;
t = ts->t;
u = ts->u;
v = ts->v;
w = ts->w;
x = ts->x;
y = ts->y;
z = ts->z;
junk2(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z);
}
int saveProcContext(struct savearea *ts)
{
int a, b, c, d, e, f, g, h, i, j, k, l, m;
int n, o, p, q, r, s, t, u, v, w, x, y, z;
ts->a = a;
ts->b = b;
ts->c = c;
ts->d = d;
ts->e = e;
ts->f = f;
ts->g = g;
ts->h = h;
ts->i = i;
ts->j = j;
ts->k = k;
ts->l = l;
ts->m = m;
ts->n = n;
ts->o = o;
ts->p = p;
ts->q = q;
ts->r = r;
ts->s = s;
ts->t = t;
ts->u = u;
ts->v = v;
ts->w = w;
ts->x = x;
ts->y = y;
ts->z = z;
}
int foo()
{
return 17;
}