-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add follow-up assert during unwinding #112817
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (1)
- src/coreclr/jit/unwindamd64.cpp: Language not supported
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
code->OpInfo = (BYTE)(genIsValidFloatReg(reg) ? reg - XMMBASE : reg); | ||
if (genIsValidFloatReg(reg)) | ||
{ | ||
code->OpInfo = reg - XMMBASE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @BruceForstall was also suggesting we validate that it's within the expected range to cover future expansions we might have
So we currently have up to 32 for both float and integer registers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was thinking something like:
unsigned unwindRegNum;
if (genIsValidFloatReg(reg))
{
unwindRegNum = reg - XMMBASE;
}
else
{
assert(genIsValidIntReg(reg));
unwindRegNum = reg;
}
assert(unwindRegNum <= 15);
code->OpInfo = (UCHAR)unwindRegNum;
assert((unsigned)code->OpInfo == unwindRegNum); // check that it fit
follow-up to #112799 (comment)