Skip to content

[NativeAOT] Fix exceptions thrown by LDiv/LMod helpers #98474

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

Merged
merged 1 commit into from
Feb 15, 2024
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ public static long LMod(long i, long j)
{
if (j == 0)
return ThrowLngDivByZero();
else if (j == -1 && i == long.MinValue)
return ThrowLngOvf();
else
return RhpLMod(i, j);
}
Expand All @@ -189,7 +191,7 @@ public static long LDiv(long i, long j)
if (j == 0)
return ThrowLngDivByZero();
else if (j == -1 && i == long.MinValue)
return ThrowLngArithExc();
return ThrowLngOvf();
else
return RhpLDiv(i, j);
}
Expand All @@ -205,12 +207,6 @@ private static ulong ThrowULngDivByZero()
{
throw new DivideByZeroException();
}

[MethodImpl(MethodImplOptions.NoInlining)]
private static long ThrowLngArithExc()
{
throw new ArithmeticException();
}
#endif // TARGET_64BIT

[RuntimeExport("Dbl2IntOvf")]
Expand Down