Commit c6500c2
[emulator] Mask memory-read-hook value to the buffer width in Python
The Python memory-read hook did result.to_bytes(buf_len, ...), which raises
OverflowError if the hook returns a value that does not fit in buf_len bytes;
the bare except then swallowed it and silently returned False, dropping a valid
hook result. Mask the value to the buffer width first (matching the C++ bridge's
truncating behavior) so it is stored instead.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent dbbd4be commit c6500c2
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
397 | 401 | | |
398 | 402 | | |
399 | 403 | | |
| |||
0 commit comments