Fix ostensive bug in sorting debugger constants
This was doing ref(foo), where foo is an Array. This will create a temporary Variant, call the ref(CVarRef) overload, which casts the temporary to a non-const RefResult, then a temporary VRefParam is implicitly constructed from this, which creates a KindOfRef and points the temporary variant at that. The sort will operate on this temporary (leading to copy on write, and storing the new ArrayData* there), so the m_constants field won't reflect the changes.
Esse commit está contido em:
@@ -65,8 +65,14 @@ void CmdConstant::onClientImpl(DebuggerClient &client) {
|
||||
} else {
|
||||
int i = 0;
|
||||
bool found = false;
|
||||
m_constants = cmd->m_constants;
|
||||
f_ksort(ref(m_constants));
|
||||
|
||||
{
|
||||
Variant forSort(cmd->m_constants);
|
||||
f_ksort(ref(forSort));
|
||||
assert(forSort.is(KindOfArray));
|
||||
m_constants = forSort.asCell()->m_data.parr;
|
||||
}
|
||||
|
||||
for (ArrayIter iter(m_constants); iter; ++iter) {
|
||||
String name = iter.first().toString();
|
||||
String value = DebuggerClient::FormatVariable(iter.second(), 200);
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário