https://git.reactos.org/?p=reactos.git;a=commitdiff;h=fd8baca9f2ef41a2e6859…
commit fd8baca9f2ef41a2e685936a94485a6e28552181
Author: Roman Masanin <36927roma(a)gmail.com>
AuthorDate: Wed Jul 28 14:34:59 2021 +0300
Commit: Stanislav Motylkov <x86corez(a)gmail.com>
CommitDate: Thu Jul 29 13:44:16 2021 +0300
[CRT/ARM] Fix modulus on division (#3856)
This fixes all tests added in 759bdedc. Addendum to f2bc1f0e.
CORE-17607 CORE-17614 CORE-17604
---
sdk/lib/crt/math/arm/__rt_div_worker.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/sdk/lib/crt/math/arm/__rt_div_worker.h
b/sdk/lib/crt/math/arm/__rt_div_worker.h
index 2b658415a3f..c920ec528e3 100644
--- a/sdk/lib/crt/math/arm/__rt_div_worker.h
+++ b/sdk/lib/crt/math/arm/__rt_div_worker.h
@@ -87,7 +87,11 @@ __rt_div_worker(
if (divisor > dividend)
{
result->data.quotient = 0;
- result->data.modulus = divisor;
+#ifdef _SIGNED_DIV_
+ if (dividend_sign)
+ dividend = -(INT3264)dividend;
+#endif // _SIGNED_DIV_
+ result->data.modulus = dividend;
return;
}