Author: kumpera
Date: 2007-12-27 16:53:21 -0500 (Thu, 27 Dec 2007)
New Revision: 91966
Added:
trunk/mono/mono/tests/verifier/invalid_non_empty_stack_at_try_begin.il
trunk/mono/mono/tests/verifier/valid_branch_to_first_intruction_of_try.il
Modified:
trunk/mono/mono/tests/verifier/ChangeLog
Log:
2007-12-27 Rodrigo Kumpera <[EMAIL PROTECTED]>
* invalid_non_empty_stack_at_try_begin.il: added.
* valid_branch_to_first_intruction_of_try.il: added.
Modified: trunk/mono/mono/tests/verifier/ChangeLog
===================================================================
--- trunk/mono/mono/tests/verifier/ChangeLog 2007-12-27 21:35:34 UTC (rev
91965)
+++ trunk/mono/mono/tests/verifier/ChangeLog 2007-12-27 21:53:21 UTC (rev
91966)
@@ -1,5 +1,12 @@
2007-12-27 Rodrigo Kumpera <[EMAIL PROTECTED]>
+ * invalid_non_empty_stack_at_try_begin.il: added.
+
+ * valid_branch_to_first_intruction_of_try.il: added.
+
+
+2007-12-27 Rodrigo Kumpera <[EMAIL PROTECTED]>
+
* make_exception_overlap_test.sh: new test generator.
* make_tests.sh: new tests for exception clause restrictions
Added: trunk/mono/mono/tests/verifier/invalid_non_empty_stack_at_try_begin.il
===================================================================
--- trunk/mono/mono/tests/verifier/invalid_non_empty_stack_at_try_begin.il
2007-12-27 21:35:34 UTC (rev 91965)
+++ trunk/mono/mono/tests/verifier/invalid_non_empty_stack_at_try_begin.il
2007-12-27 21:53:21 UTC (rev 91966)
@@ -0,0 +1,58 @@
+
+// invalid CIL which breaks the ECMA-335 rules.
+// this CIL should fail verification by a conforming CLI verifier.
+
+.assembly 'invalid_non_empty_stack_at_try_begin'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+
+.class ClassA
+ extends [mscorlib]System.Object
+{
+}
+
+.class sealed MyValueType
+ extends [mscorlib]System.ValueType
+{
+ .field private int32 v
+}
+
+.class public Template`1<T>
+ extends [mscorlib]System.Object
+{
+}
+
+.class sealed public ValueTypeTemplate`1<T>
+ extends [mscorlib]System.ValueType
+{
+ .field private int32 v
+}
+
+.method public static int32 Main() cil managed
+{
+ .entrypoint
+ .maxstack 8
+ .locals init (object _XO, int32 _X1)
+
+ nop
+ ldloc.1
+
+ .try {
+ pop
+ newobj instance void class [mscorlib]System.Exception::.ctor()
+ throw
+ nop
+ leave END
+ } catch [mscorlib]System.Exception {
+ stloc.0
+ nop
+ nop
+ leave END
+ }
+
+END:
+ ldc.i4.0
+ ret
+}
Added: trunk/mono/mono/tests/verifier/valid_branch_to_first_intruction_of_try.il
===================================================================
--- trunk/mono/mono/tests/verifier/valid_branch_to_first_intruction_of_try.il
2007-12-27 21:35:34 UTC (rev 91965)
+++ trunk/mono/mono/tests/verifier/valid_branch_to_first_intruction_of_try.il
2007-12-27 21:53:21 UTC (rev 91966)
@@ -0,0 +1,60 @@
+
+// valid CIL which breaks the ECMA-335 rules.
+// this CIL should fail verification by a conforming CLI verifier.
+
+.assembly 'valid_branch_inside_same_block_1_generated'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+
+.class ClassA
+ extends [mscorlib]System.Object
+{
+}
+
+.class sealed MyValueType
+ extends [mscorlib]System.ValueType
+{
+ .field private int32 v
+}
+
+.class public Template`1<T>
+ extends [mscorlib]System.Object
+{
+}
+
+.class sealed public ValueTypeTemplate`1<T>
+ extends [mscorlib]System.ValueType
+{
+ .field private int32 v
+}
+
+.method public static int32 Main() cil managed
+{
+ .entrypoint
+ .maxstack 8
+ .locals init (object _X0, int32 _X1)
+
+ nop
+ nop
+ ldloc.1
+ brtrue BLOCK_1
+
+BLOCK_1:
+ .try {
+ nop
+ newobj instance void class [mscorlib]System.Exception::.ctor()
+ throw
+ nop
+
+ leave END
+ } catch [mscorlib]System.Exception {
+ stloc.0
+ leave END
+ }
+
+END:
+ ldc.i4.0
+ ret
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches