summaryrefslogtreecommitdiff
path: root/examples/popbug3.nl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/popbug3.nl')
-rw-r--r--examples/popbug3.nl21
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/popbug3.nl b/examples/popbug3.nl
new file mode 100644
index 0000000..5a8cd59
--- /dev/null
+++ b/examples/popbug3.nl
@@ -0,0 +1,21 @@
+/* This program makes B return multiple times, and each time
+ * the "7" is popped from the stack, causing the stack to become
+ * underfull
+ */
+
+ret: label = null;
+
+B() -> int32
+{
+ ret = back;
+ goto out;
+
+ @back:
+ return 20;
+}
+
+print 7 + B();
+
+@out:
+print "asdf";
+goto ret;