diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-17 16:54:36 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-19 11:28:25 +0000 |
commit | c21bc1cdef5ae0f1e6bd43ac0a6c324a59d4e34b (patch) | |
tree | 5fb96be159e6d2e0b17589e8fedf18eedf8b17cf /src | |
parent | cfc73960f2d55fa141edbadea7616a7f7f947877 (diff) | |
download | qtdeclarative-c21bc1cdef5ae0f1e6bd43ac0a6c324a59d4e34b.tar.gz qtdeclarative-c21bc1cdef5ae0f1e6bd43ac0a6c324a59d4e34b.tar.bz2 qtdeclarative-c21bc1cdef5ae0f1e6bd43ac0a6c324a59d4e34b.zip |
V4 Debugger: Avoid special refs when looking up normal ones
The "values" of "special" refs are always JavaScript "undefined"s.
Thus, when trying to deduplicate an actual "undefined" we'd
accidentally hit the special refs. Avoid this by checking if a found
ref is special.
In an ideal world we'd get rid of the special refs altogether and
save QV4::FunctionObject in the values array, but that is not quite
trivial as long as the QV4::ExecutionEngine::stackTrace() doesn't
give us FunctionObjects.
Task-number: QTBUG-47788
Change-Id: Idf358c285f40930220fad2207c6ab5c9101573b2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp index 64ee5c3b9..a44acdd37 100644 --- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp +++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp @@ -236,7 +236,7 @@ QV4DataCollector::Ref QV4DataCollector::addRef(QV4::Value value, bool deduplicat QV4::ScopedObject array(scope, values.value()); if (deduplicate) { for (Ref i = 0; i < array->getLength(); ++i) { - if (array->getIndexed(i) == value.rawValue()) + if (array->getIndexed(i) == value.rawValue() && !specialRefs.contains(i)) return i; } } |