search for: 3759ce0

Displaying 1 result from an estimated 1 matches for "3759ce0".

Did you mean: 375900
2011 Mar 10
1
[LLVMdev] compiler-rt: Infinite loop/stack overflow in __modsi3()
...VM is smart enough to do tail call elimination on the recursion, so I got an infinite loop rather than a stack overflow :) Here's the patch, patterned after the correct implementation in umodsi3.c: diff --git a/lib/compiler-rt/lib/modsi3.c b/lib/compiler-rt/lib/modsi3.c index 388418a..3759ce0 100644 --- a/lib/compiler-rt/lib/modsi3.c +++ b/lib/compiler-rt/lib/modsi3.c @@ -16,8 +16,10 @@ /* Returns: a % b */ +su_int __divsi3(si_int a, si_int b); + si_int __modsi3(si_int a, si_int b) { - return a - (a / b) * b; + return a - __divsi3(a, b) * b; } Best, Matt