You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider an IInstrumentationMethod implementation where ShouldInstrumentMethod indicates that only System::String System::String::Concat(System::String[]) should be instrumented, and where InstrumentMethod includes the following:
In such a case, we are seeing that one of the brtrue instructions has an invalid target instruction. If pNopInstr is not added at the beginning of the method, then there are no invalid instructions.
Without inserting a nop at the beginning of the method:
Note the IL_0025: brtrue IL_003E instruction that exists without the nop. After inserting the nop, it is changed to IL_0026: brtrue IL_003E, which still targets the now-nonexistent IL_003E instruction (it should have been changed to IL_003F).
Would you mind letting us know what version of the CLR/CoreCLR you are encountering this in? If we are going to reproduce it, we would like to make sure that we are working against the same version of the assembly which you are seeing the problem in.
The example IL was from a .NET Core 2.1 app running on the Microsoft.AspNetCore.App 2.1.22 runtime, but the same behavior has also been experienced with a .NET Core 3.1 app running on Microsoft.AspNetCore.App 3.1.8 and a .NET Framework 4.8 app.
Consider an
IInstrumentationMethod
implementation whereShouldInstrumentMethod
indicates that onlySystem::String System::String::Concat(System::String[])
should be instrumented, and whereInstrumentMethod
includes the following:In such a case, we are seeing that one of the
brtrue
instructions has an invalid target instruction. IfpNopInstr
is not added at the beginning of the method, then there are no invalid instructions.Without inserting a
nop
at the beginning of the method:With inserting a
nop
at the beginning of the method:Note the
IL_0025: brtrue IL_003E
instruction that exists without thenop
. After inserting thenop
, it is changed toIL_0026: brtrue IL_003E
, which still targets the now-nonexistentIL_003E
instruction (it should have been changed toIL_003F
).string_concat_1_without_nop.log
string_concat_2_with_nop.log
The text was updated successfully, but these errors were encountered: