Fix incorrect faulting instruction update in BNDCHK implicit null check - #24586
Open
AbdallahAbd05 wants to merge 1 commit into
Open
Fix incorrect faulting instruction update in BNDCHK implicit null check#24586AbdallahAbd05 wants to merge 1 commit into
AbdallahAbd05 wants to merge 1 commit into
Conversation
Member
|
Thanks for figuring out the problem. I think the change looks correct. May I ask you to provide more information in the commit comment indicating why the change is being made? Some of the same information that you've provided in the pull request description above would be appropriate. Also, could you add a comment here showing the relevant IL that could give rise to a |
When a BNDCHK has a foldedImplicitNULLCHK, the function setImplicitNULLCHKExceptionInfo attempts to correctly identify the faulting instruction. The condition checked for both CMP4MemReg and CMP4RegMem, but CMP4RegMem loads from an object field rather than the array, so it cannot be the faulting instruction for a null array access. This caused the stack walker to fail to find the stack map, hitting a fatal assertion in jswalk.c. The fix removes CMP4RegMem from the condition, keeping only CMP4MemReg which correctly identifies a cmp that loads array length from the array.
AbdallahAbd05
force-pushed
the
fix-bndchkImplicitNullStackMap
branch
from
August 26, 2026 18:59
5f425d3 to
670a110
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a
BNDCHKhas afoldedImplicitNULLCHK, the functionsetImplicitNULLCHKExceptionInfoattempts to correctly identify the faulting instruction. The condition checked for bothCMP4MemRegandCMP4RegMem, butCMP4RegMemloads from an object field (e.g. idx from 'this') rather than the array, so it cannot be the faulting instruction for a null array access. This caused the stack walker to fail to find the stack map, hitting a fatal assertion in jswalk.c.The fix removes
CMP4RegMemfrom the condition, keeping onlyCMP4MemRegwhich correctly identifies a cmp that loads array length from the array.Fixes #24569