Key generator behavior for values above 2^53 is inconsistent |
||
Issue descriptionSpec bug: https://github.com/w3c/IndexedDB/issues/147 Test cases: https://github.com/w3c/web-platform-tests/pull/4814 Spec has inconsistencies here, but Chrome's impl is reliant on undefined behavior: https://cs.chromium.org/chromium/src/content/browser/indexed_db/indexed_db_database.cc?l=1204 The incoming key - a number which is a double and therefore could be Infinity or > 2^63 - is coerced via; static_cast<int64_t>(floor(key.number())) + 1 I have no idea what Infinity ends up doing here (it's undefined behavior per C++). We end up ignoring it so it probably becomes 0 or something which is safe but we need to bounds check and figure out what the desired behavior is. Fun cases: * Anything about the generator maximum value (2^53) * Anything above that but that fits into int64_t * Anything above that but that fits into uint64_t * Anything above that but finite * Infinity
,
Mar 8 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by bugdroid1@chromium.org
, Mar 7 2017