Bug 166413

Summary: Math.min changes behavior with negative zero when tiering up
Product: WebKit Reporter: Keith Miller <keith_miller>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Keith Miller
Reported 2016-12-21 21:46:45 PST
It looks like the code converts the min(a, b) into a < b ? a : b. This does not work for -0.0 and 0.0: Test case: function test(value, iter) { if (Infinity/value !== -Infinity) throw new Error(iter); } noInline(test); function foo(a, b, iter) { test(Math.min(a, b), iter); } noInline(foo); for (let i = 0; i < 10000; i++) { foo(-0.0, 0.0, i); }
Attachments
Radar WebKit Bug Importer
Comment 1 2016-12-21 21:47:23 PST
Note You need to log in before you can comment on or make changes to this bug.