From 273a5368fb5b7e919011c3774317c302d1bad87d Mon Sep 17 00:00:00 2001 From: qunyanm Date: Fri, 26 Feb 2016 10:37:53 -0800 Subject: Fix issue 140. Move the initializion of _this before the TAIL_CALL_START label. --- Source/Dafny/Compiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/Dafny/Compiler.cs b/Source/Dafny/Compiler.cs index f5f95bd2..d6b2d9ba 100644 --- a/Source/Dafny/Compiler.cs +++ b/Source/Dafny/Compiler.cs @@ -937,10 +937,10 @@ namespace Microsoft.Dafny { Error("Method {0} has no body", wr, m.FullName); } else { if (m.IsTailRecursive) { - Indent(indent, wr); wr.WriteLine("TAIL_CALL_START: ;"); if (!m.IsStatic) { Indent(indent + IndentAmount, wr); wr.WriteLine("var _this = this;"); } + Indent(indent, wr); wr.WriteLine("TAIL_CALL_START: ;"); } Contract.Assert(enclosingMethod == null); enclosingMethod = m; -- cgit v1.2.3