Skip to content
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

Fix CodeQL issue cpp/enum-index in mono #101751

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mono/mono/mini/mini-amd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static const char * const single_xmmregs [] = {
const char*
mono_arch_fregname (int reg)
{
if (reg < AMD64_XMM_NREG)
if (reg >= 0 && reg < AMD64_XMM_NREG)
return single_xmmregs [reg];
else
return "unknown";
Expand All @@ -136,7 +136,7 @@ mono_arch_fregname (int reg)
const char *
mono_arch_xregname (int reg)
{
if (reg < AMD64_XMM_NREG)
if (reg >= 0 && reg < AMD64_XMM_NREG)
return packed_xmmregs [reg];
else
return "unknown";
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/mini-s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ mono_arch_fregname (int reg)
const char *
mono_arch_xregname (int reg)
{
if (reg < s390_VR_NREG)
if (reg >= 0 && reg < s390_VR_NREG)
return vrNames [reg];
else
return "unknown";
Expand Down
Loading