aboutsummaryrefslogtreecommitdiff
path: root/tests/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stack.c')
-rw-r--r--tests/stack.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/stack.c b/tests/stack.c
new file mode 100644
index 0000000..36885d9
--- /dev/null
+++ b/tests/stack.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+void rec(int *ip);
+
+/* stack.c -- Cause a stack overflow */
+int main(void) {
+ int i = 0;
+ rec(&i);
+}
+void rec(int *ip) {
+ char i[256];
+ printf("%u\n", (*ip)++);
+ rec(ip);
+}
+