summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression/CLR-x86-JIT/V1-M09.5-PDC/b16335/b16335.cs
blob: fc46db66f06f8044271c51b92798420a6fbe6d8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

namespace DefaultNamespace
{
    using System;

    class BB
    {
        public static bool[] m_static1 = new bool[7];
        public BB[] Method1()
        {
            return new BB[7];
        }
        public bool[] m_field2;
    }

    class DD
    {
        public static BB m_static2 = new BB();

        public static int Main()
        {
            try
            {
                new BB().Method1()[2].m_field2 = BB.m_static1;		//Normally, must throw NullReferenceException
            }
            catch (NullReferenceException)
            {
                return 100;
            }
            return 1;
        }
    }
}