[Webkit-unassigned] [Bug 94779] To reduce cost of converting type during modulo for integers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 17 21:21:26 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94779





--- Comment #14 from Filip Pizlo <fpizlo at apple.com>  2012-09-17 21:21:56 PST ---
Created an attachment (id=164488)
 --> (https://bugs.webkit.org/attachment.cgi?id=164488&action=review)
test case for C modulo

Run this on your compute:

cc -o test test.c
./test -2147483648 -1

You should get a SIGFPE on UNIX-like systems, or whatever the equivalent exception is on non-UNIX systems.

In general it is not safe to use C modulo for -2147483648/-1.

The reason why that code was written to call fmod() instead of using C modulo in the first place, was to ensure that we avoided this corner case.

While I appreciate that there are things that can be done to optimize this code path, I don't think you have done so in a safe way.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list