Summary: | [Qt] QScriptValue::equals asserts | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jędrzej Nowacki <jedrzej.nowacki> | ||||||
Component: | JavaScriptCore | Assignee: | Jędrzej Nowacki <jedrzej.nowacki> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, jedrzej.nowacki, kenneth, kent.hansen | ||||||
Priority: | P2 | Keywords: | Qt, QtTriaged | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 31863 | ||||||||
Attachments: |
|
Description
Jędrzej Nowacki
2010-07-15 06:12:24 PDT
Created attachment 61651 [details] Fix v1 I don't provide an additional tests, the crash is in our benchmarks so in a teory it is tested. I think we should test the case using existing tests, so I created bug 42366. Comment on attachment 61651 [details] Fix v1 > +inline bool JSCompare(qsreal a, qsreal b) > +{ > + return a == b > + || (qIsInf(a) && qIsInf(b)) > + || (qIsNaN(a) && qIsNaN(b)); > +} The Inf and NaN parts aren't correct. NaN should not be equal to NaN. -Inf should not be equal to +Inf. So this helper function isn't needed, == can be used inplace. Instead of Q_ASSERT(false) in the default case, I'd prefer a Q_ASSERT_X(false, "equals()", Not all states are included in the previous switch statement."), like existing switches do. Otherwise it looks good. Created attachment 62421 [details]
Fix v2
New version:
- JSCompare function was removed
- The assert was replaced by a more verbose one.
Comment on attachment 62421 [details] Fix v2 Clearing flags on attachment: 62421 Committed r63980: <http://trac.webkit.org/changeset/63980> All reviewed patches have been landed. Closing bug. |