niti: fix escaping flag when executing the finish of with
authorJean Privat <jean@pryen.org>
Thu, 24 Mar 2016 22:44:29 +0000 (18:44 -0400)
committerJean Privat <jean@pryen.org>
Thu, 24 Mar 2016 22:44:29 +0000 (18:44 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/interpreter/naive_interpreter.nit

index 213680e..c596f16 100644 (file)
@@ -1838,7 +1838,13 @@ redef class AWithExpr
                v.callsite(method_start, [expr])
                v.stmt(self.n_block)
                v.is_escape(self.break_mark) # Clear the break
+
+               # Execute the finally without an escape
+               var old_mark = v.escapemark
+               v.escapemark = null
                v.callsite(method_finish, [expr])
+               # Restore the escape unless another escape was provided
+               if v.escapemark == null then v.escapemark = old_mark
        end
 end