Closed
Bug 1140556
Opened 11 years ago
Closed 11 years ago
Adding an item crashes on 32 bit devices
Categories
(Firefox for iOS :: Reader View, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: st3fan, Assigned: st3fan)
References
Details
Attachments
(1 file)
This is because our SQLite wrapper does not handle 64 bit integer values. That has been fixed with bug 1132500 so all the reader code now needs is to properly wrap Int64 values into NSNumber instances.
| Assignee | ||
Comment 1•11 years ago
|
||
This fixes a bug where adding items to your reading list crashes on 32 bit devices.
We were using the `Int` type to store the timestamp. The `Int` type is architecture dependend, so on our fancy 64 bit test phones this is all good, but on Mark's wimpy 32-bit iPod Touch, it wont fit because the timestamp is a 12 digit number that obviously does not fit in an `Int32`.
The primary reason for the crash is that the Swift runtime throws an assertion when we stuff `NSTimeInterval * 1000.0` into an `Int`:
> floating point value can not be converted to Int because it is greater than Int.max
The obvious solution here is to use Int64 of course. But there is a problem. The SQLite wrapper does not actually support 64 bit values. So that was first fixed with bug [https://bugzilla.mozilla.org/show_bug.cgi?id=1132500](1132500).
In the end all this patch does it change timestamp types to `Int64` and then in the database code wrap those in `NSNumber` instances.
And it adds a test to find out if timestamp values are properly stored and retrieved. Our CI builds now also run on both a 32 and 64 bit simulator.
Attachment #8574147 -
Flags: review?(nalexander)
Comment 2•11 years ago
|
||
Comment on attachment 8574147 [details] [review]
PR: https://github.com/mozilla/firefox-ios/pull/203
WFM.
Attachment #8574147 -
Flags: review?(nalexander) → review+
| Assignee | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•