Commit 46cda59
JIT: fix arm32 dump/disasm of references to async resume info (dotnet#123814)
## Description
ARM32 JIT dump/disasm asserts when encountering async resume info
references. The `IF_T2_N2` instruction format handles both block address
tables and async resume info, but the dump logic only expected the
former.
## Changes
- **Remove assert in `emitarm.cpp:7308`**: Was failing when `jdsc` is
null (async resume info case)
- **Add null check before table dump**: Skip inline block address table
dump when `jdsc` is null
- **Use `nullptr` instead of `NULL`**: Modern C++ style throughout the
code block
- **Add conditional printing**: Print `RWD%02zu` format for async resume
info (when `jdsc` is null) and `J_M%03u_DS%02u` format for block address
tables (when `jdsc` is not null)
- **Clarify comment**: Document when `jdsc` is null vs non-null
The fix preserves all existing dump behavior for block address tables
while allowing async resume info to display properly without assertion.
```cpp
// Before: would assert if jdsc is null and always print as DS format
assert(jdsc != NULL);
printf("... J_M%03u_DS%02u", ...);
if (id->idIns() == INS_movt) { /* dump table using jdsc */ }
// After: skip table dump when jdsc is null and use appropriate format
if (jdsc != nullptr)
printf("... J_M%03u_DS%02u", ...); // block address table
else
printf("... RWD%02zu", ...); // async resume info
if (jdsc != nullptr && id->idIns() == INS_movt) { /* dump table using jdsc */ }
```
Affects dump/disasm output only; no impact on code generation.
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>JIT: fix arm32 dump/disasm of references to async resume
info</issue_title>
> <issue_description>See
dotnet#123781 (comment)
>
> Seemingly `IF_T2_N2` expects the data to resolve to a table of block
addresses, so if we reuse this form for references to async resume info
it doesn't display properly.
>
> I think this just impacts dumping and disasm. But not 100% sure.
> </issue_description>
>
> <agent_instructions>Fix this issue by handling gracefully the
situation where `jdsc` is null -- skip the inline table dump logic in
that case</agent_instructions>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes dotnet#123813
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/dotnet/runtime/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>1 parent e0e5fe0 commit 46cda59
1 file changed
Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7285 | 7285 | | |
7286 | 7286 | | |
7287 | 7287 | | |
7288 | | - | |
| 7288 | + | |
7289 | 7289 | | |
7290 | 7290 | | |
7291 | 7291 | | |
| |||
7305 | 7305 | | |
7306 | 7306 | | |
7307 | 7307 | | |
7308 | | - | |
7309 | | - | |
7310 | 7308 | | |
7311 | 7309 | | |
7312 | 7310 | | |
7313 | 7311 | | |
7314 | | - | |
7315 | | - | |
7316 | 7312 | | |
7317 | | - | |
7318 | | - | |
| 7313 | + | |
| 7314 | + | |
| 7315 | + | |
| 7316 | + | |
| 7317 | + | |
| 7318 | + | |
| 7319 | + | |
| 7320 | + | |
| 7321 | + | |
| 7322 | + | |
| 7323 | + | |
| 7324 | + | |
| 7325 | + | |
7319 | 7326 | | |
7320 | 7327 | | |
7321 | 7328 | | |
7322 | 7329 | | |
7323 | | - | |
| 7330 | + | |
7324 | 7331 | | |
7325 | 7332 | | |
7326 | 7333 | | |
| |||
0 commit comments