Meta: Avoid showing elements in extremely large vectors in gdb

This is most often just an invalid vector anyway.
This commit is contained in:
Ali Mohammad Pur 2022-04-02 00:37:19 +04:30 committed by Linus Groh
parent 899888bbf2
commit 265dd9b445

View file

@ -251,6 +251,10 @@ class AKVector:
else:
elements = get_field_unalloced(self.val, "m_inline_buffer_storage", inner_type_ptr)
# Very arbitrary limit, just to catch UAF'd and garbage vector values with a silly number of elements
if vec_len > 373373:
return []
return [(f"[{i}]", elements[i]) for i in range(vec_len)]
@classmethod