From 0e3eb21c2266abb55b1490f0231a2ad59bfc1aba Mon Sep 17 00:00:00 2001 From: Sejong Oh Date: Tue, 5 Apr 2016 17:52:14 -0700 Subject: Fix JIT crash with static function accessing non-static field The IL below is invalid since the static function acceses the non-static field. On Desktop CRL, JIT throws a verification exception. However, CoreCLR doesn't support verification and JIT crashes. This fix makes JIT throw a invalid program exception if verification is disabled. .field int32 i .method static int32 f() { ldsfld int32 Test::i ret } The test also expects InvalidProgramException instead of VerificationException. --- tests/src/JIT/Directed/coverage/importer/Desktop/badldsfld.il | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/src') diff --git a/tests/src/JIT/Directed/coverage/importer/Desktop/badldsfld.il b/tests/src/JIT/Directed/coverage/importer/Desktop/badldsfld.il index 4a5831565c..3671aa22fa 100644 --- a/tests/src/JIT/Directed/coverage/importer/Desktop/badldsfld.il +++ b/tests/src/JIT/Directed/coverage/importer/Desktop/badldsfld.il @@ -17,7 +17,7 @@ ret call int32 Test::f() leave.s FAIL } -catch [mscorlib]System.Security.VerificationException +catch [mscorlib]System.InvalidProgramException { leave.s PASS } @@ -28,4 +28,4 @@ FAIL: ldc.i4 1 ret } -} \ No newline at end of file +} -- cgit v1.2.3