Merge pull request #4419 from BrzVlad/fix-oom-nre
[mono.git] / mono / mini / exceptions.cs
index 0148488dee3a3ab0ca92865eaf656c14f4a0fb93..98c6046e61a5cdea5dab273ee1b289d63c26a7b5 100644 (file)
@@ -2318,6 +2318,7 @@ class Tests
                Console.WriteLine ();
        }
 
+       [Category ("!BITCODE")]
        public static int test_0_rethrow_stacktrace () {
                // Check that rethrowing an exception preserves the original stack trace
                try {
@@ -2816,6 +2817,34 @@ class Tests
                }
                return finally_called ? 0 : 1;
        }
+
+       static int array_len_1 = 1;
+
+       public static int test_0_bounds_check_negative_constant () {
+               try {
+                       byte[] arr = new byte [array_len_1];
+                       byte b = arr [-1];
+                       return 1;
+               } catch {
+               }
+               try {
+                       byte[] arr = new byte [array_len_1];
+                       arr [-1] = 1;
+                       return 2;
+               } catch {
+               }
+               return 0;
+       }
+
+       public static int test_0_string_bounds_check_negative_constant () {
+               try {
+                       string s = "A";
+                       char c = s [-1];
+                       return 1;
+               } catch {
+               }
+               return 0;
+       }
 }
 
 #if !__MOBILE__