Commit 1066cf73 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk

Debugger[gdb]: Fix crash when stepping over QLocale initialization.

Check the index before the array is accessed in the call item.

Task-number: QTCREATORBUG-5576
Change-Id: I3f533ef76af42dad97c93087f2d434b58fdedd44
Reviewed-on: http://codereview.qt.nokia.com/2044Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarOswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: default avatarhjk <qthjk@ovi.com>
parent 81bb1c98
......@@ -556,8 +556,19 @@ def qdump__QLinkedList(d, item):
d.putSubItem(Item(p["t"], item.iname, i))
p = p["n"]
qqLocalesCount = None
def qdump__QLocale(d, item):
# Check for uninitialized 'index' variable. Retrieve size of QLocale data array
# from variable in qlocale.cpp (default: 368/Qt 4.8), 368 being 'System'.
global qqLocalesCount
if qqLocalesCount is None:
try:
qqLocalesCount = int(value(qtNamespace() + 'locale_data_size'))
except:
qqLocalesCount = 368
index = int(item.value["p"]["index"])
check(index >= 0 and index <= qqLocalesCount)
d.putStringValue(call(item.value, "name"))
d.putNumChild(0)
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment