From c21bc1cdef5ae0f1e6bd43ac0a6c324a59d4e34b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 17 Aug 2015 16:54:36 +0200 Subject: 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 --- src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp index 64ee5c3b96..a44acdd370 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; } } -- cgit v1.2.3