修复 EvalStackCalculator::SimulateRunAllBlocks 计算返回值包含`creq`的函数(如`int XXX{ init;}`的setter函数)的进出栈参数时由于没有对method.ReturnType RemovePinnedAndModifiers,导致错误地判定为methodHasReturnValue,导致进出栈错误的bug

dev
walon 2025-06-26 08:13:24 +08:00
parent 2572841e59
commit 72d0b292c5
1 changed files with 1 additions and 1 deletions

View File

@ -253,7 +253,7 @@ namespace Obfuz.Emit
private void SimulateRunAllBlocks()
{
Dictionary<BasicBlock, EvalStackState> blockEvalStackStates = _basicBlocks.Blocks.ToDictionary(b => b, b => new EvalStackState());
bool methodHasReturnValue = _method.ReturnType.ElementType != ElementType.Void;
bool methodHasReturnValue = _method.ReturnType.RemovePinnedAndModifiers().ElementType != ElementType.Void;
CilBody body = _method.Body;
if (body.HasExceptionHandlers)