[mono][interp] Fix an issue with deopt and interpreter tiering. (#76743)
authorZoltan Varga <vargaz@gmail.com>
Fri, 14 Oct 2022 19:48:13 +0000 (15:48 -0400)
committerGitHub <noreply@github.com>
Fri, 14 Oct 2022 19:48:13 +0000 (14:48 -0500)
commita07188777ffa92adc8a00ca974bd1c63156d19f1
tree5705f6a02239ffb7aa53e138c479eb92292f7b11
parent3b1df9396e2a7cc6797e76793e8547f8a7771953
[mono][interp] Fix an issue with deopt and interpreter tiering. (#76743)

* [mono][interp] Fix an issue with deopt and interpreter tiering.

If a method is tiered while being run from interp_run_clause_with_il_state (),
the clause_args argument to interp_exec_method () still contains the old IL
offsets confusing the EH code, i.e. this line:
```
if (clause_args && frame == clause_args->exec_frame && context->handler_ip >= clause_args->end_at_ip)
```

Clear out clause_args at the beginning to avoid this.

Hopefully fixes
https://github.com/dotnet/runtime/issues/76134
https://github.com/dotnet/runtime/issues/74302

* [mono][interp] Avoid tiering up methods while running clauses.

The IL offsets in the clause_args argument become out-of-date after tiering up.
src/mono/mono/mini/interp/interp.c