diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2024-04-16 11:40:10 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-04-26 07:13:50 +0200 |
commit | 23fc22e16022e355f2a1aff8705c09b807fbe024 (patch) | |
tree | 1e30c3c7d5897fa1e48071a8d0238083baff82a9 /src/qml/jsruntime/qv4jscall_p.h | |
parent | 372db480cda5899148629d8edad76405bc1b98de (diff) |
QmlCompiler: Consider lengths to be qsizetype
This is what we get as "source material" from all the containers. In
JavaScript, arrays sizes are up to 32bit unsigned, but we need to
represent -1 in a few places. Therefore, we cannot clamp the result to
32bit signed if the underlying container supports 64bit indices.
We can change qjslist.h here because this header is only supposed to be
used from generated code. Therefore, if you rebuild any users of this
code, you will also re-generate them, adapting to the new API.
Since we check for QJSNumberCoercion::isArrayIndex() before we use any
number as an array index when generating code, this is actually safe. We
just need to adapt isArrayIndex() to consider numbers greater than
INT_MAX as possible values.
Fixes: QTBUG-122582
Change-Id: I1147978a05bfedb63037c7f4437921f85a6aabb1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4jscall_p.h')
0 files changed, 0 insertions, 0 deletions