2010-02-06 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Sat, 6 Feb 2010 08:14:28 +0000 (08:14 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sat, 6 Feb 2010 08:14:28 +0000 (08:14 -0000)
* eval.cs (CompileBlock): Also undo if there are problems during
semantic analysis, fixes various cases where invalid C# code would
be reported, but the internal changes would not be undone.

svn path=/trunk/mcs/; revision=150974

mcs/mcs/ChangeLog
mcs/mcs/eval.cs

index 89b8a07ce16939563f9060fea786fd9c23958103..de96729821a20ff85f0e7f950dc91e0933eb6ddb 100644 (file)
@@ -1,3 +1,9 @@
+2010-02-06  Miguel de Icaza  <miguel@novell.com>
+
+       * eval.cs (CompileBlock): Also undo if there are problems during
+       semantic analysis, fixes various cases where invalid C# code would
+       be reported, but the internal changes would not be undone.
+
 2010-02-03  Miguel de Icaza  <miguel@novell.com>
 
        * driver.cs: Change the --fatal flag to allow a number to be
index ba5162a9ac29e574454d34873771d736a9759c09..ced26cd301a4f763dcb9b43aa64f0839590c3040 100644 (file)
@@ -726,8 +726,10 @@ namespace Mono.CSharp {
                        }
                        
                        RootContext.EmitCode ();
-                       if (Report.Errors != 0)
+                       if (Report.Errors != 0){
+                               undo.ExecuteUndo ();
                                return null;
+                       }
                        
                        RootContext.CloseTypes ();