[tools] Fix class_ptr rewriter to patch exception handlers too when instructions change. - #22565
Conversation
…nstructions change.
Fixes these test failures when running a release build with all optimizations and the static registrar:
MonoTouchFixtures.AppKit.NSGridViewTest
[FAIL] CreateWithNSViewArrayOfArrayCheckDifferentArrayLength : System.InvalidProgramException : InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[][])
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckDifferentArrayLength()
at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
[FAIL] CreateWithNSViewArrayOfArrayCheckNSTextView : System.InvalidProgramException : InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[][])
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckNSTextView()
at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
[FAIL] CreateWithNSViewArrayOfArrayCheckWithNull : Broken Array #3
Expected: <System.ArgumentNullException>
But was: <System.InvalidProgramException: InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[][])
at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass6_0.<CreateWithNSViewArrayOfArrayCheckWithNull>b__0()
at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNull()
[FAIL] CreateWithNSViewArrayOfArrayCheckWithNullArray : Broken Array #2
Expected: <System.ArgumentNullException>
But was: <System.InvalidProgramException: InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[][])
at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass5_0.<CreateWithNSViewArrayOfArrayCheckWithNullArray>b__0()
at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNullArray()
[FAIL] CreateWithNSViewArrayOfArrayCheckWithNullNSView : Broken Array #1
Expected: <System.ArgumentNullException>
But was: <System.InvalidProgramException: InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[][])
at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass4_0.<CreateWithNSViewArrayOfArrayCheckWithNullNSView>b__0()
at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNullNSView()
[FAIL] CreateWithTwoDimensionalNSViewArrayCheckDifferentDimensionSize : System.InvalidProgramException : InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[,])
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayCheckDifferentDimensionSize()
at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
[FAIL] CreateWithTwoDimensionalNSViewArrayCheckWithNull : Broken Array #4
Expected: <System.ArgumentNullException>
But was: <System.InvalidProgramException: InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[,])
at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass7_0.<CreateWithTwoDimensionalNSViewArrayCheckWithNull>b__0()
at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayCheckWithNull()
[FAIL] CreateWithTwoDimensionalNSViewArrayNSTextView : System.InvalidProgramException : InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[,])
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayNSTextView()
at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
[FAIL] CreateWithTwoDimensionalNSViewArrayWithNullCell : Broken Array #5
Expected: <System.ArgumentNullException>
But was: <System.InvalidProgramException: InvalidProgram_Default
at AppKit.NSGridView.Create(NSView[,])
at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass8_0.<CreateWithTwoDimensionalNSViewArrayWithNullCell>b__0()
at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>
at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayWithNullCell()
✅ [CI Build #b669991] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #b669991] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build #b669991] Build passed (Build macOS tests) ✅Pipeline on Agent |
💻 [CI Build #b669991] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )❗ API diff vs stable (Breaking changes).NET ( ❗ Breaking changes ❗ )✅ Generator diffGenerator diff is empty Pipeline on Agent |
💻 [CI Build #b669991] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build #b669991] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #b669991] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
🚀 [CI Build #b669991] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 115 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Fixes these test failures when running a release build with all optimizations and the static registrar: