shithub: mc

Download patch

ref: fbfb5b8b56c027a676e1e0c6a78feadcc23a8606
parent: fdbbf1909462cef844b6b9cbbc5d90a9ec2ebed2
author: Ori Bernstein <[email protected]>
date: Wed May 25 07:27:44 EDT 2016

Make the test fail if setjmp returns true

    We used to not track whether we actually were getting
    to the nonlocal return through an actual nonlocal return.

    Now the return needs to be nonlocal if we're to return
    successfully.

--- a/lib/std/test/sjlj.myr
+++ b/lib/std/test/sjlj.myr
@@ -1,12 +1,14 @@
 use std
 
 const main = {
-	var jb
+	var jb, st
 
+	st = 1
 	if std.setjmp(&jb)
 		std.put("nonlocal return\n")
-		std.exit(0)
+		std.exit(st)
 	;;
+	st = 0
 	std.put("doing jmp\n")
 	dolongjmp(&jb)
 	std.fatal("unreachable\n")