[Webkit-unassigned] [Bug 61416] [JSC] malfunction during arithmetic condition check with negative number (-2147483648)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 26 06:41:25 PDT 2011


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





--- Comment #12 from hojong.han at samsung.com  2011-05-26 06:41:24 PST ---
(In reply to comment #6)
> A fix like this really ought to be accompanied by a regression test.
> 
> This can be really easy, you should be able to just find a test in the LayoutTests/fast/js directory with 'arithmetic' or 'comparisons' in the name, add something like:
> 
> var testValue = 10;
> shouldBeFalse("testValue < -2147483648");
> 
> And run the layout test to get updated results (which will just be a line saying PASS).
> 
> cheers,
> G.

I added test code like below into the JS file (Source/JavaScriptCore/tests/mozilla/ecma/Array/15.4.1.1.js) for JSC regression test and then ran "./jsc_efl -s -f shell.js 15.4.1.1.js"

[Test case code]
array[item++] = new TestCase( SECTION,    "var f = 10; var g; if(f < -2147483648) g = false; else g = true; g.toString()",  "true",  eval("var f = 10; var g; if(f < -2147483648) g = false; else g = true; g.toString()") );

[Before fixed]
var f = 10; var g; if(f < -2147483648) g = false; else g = true; g.toString() = false FAILED! expected: true

[After fixed]
var f = 10; var g; if(f < -2147483648) g = false; else g = true; g.toString() = true PASSED!

-- 
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