================
@@ -18,39 +18,35 @@
 using namespace lldb;
 using namespace lldb_private;
 
-ValueObjectPrinter::ValueObjectPrinter(ValueObject *valobj, Stream *s) {
-  if (valobj) {
-    DumpValueObjectOptions options(*valobj);
-    Init(valobj, s, options, m_options.m_max_ptr_depth, 0, nullptr);
-  } else {
-    DumpValueObjectOptions options;
-    Init(valobj, s, options, m_options.m_max_ptr_depth, 0, nullptr);
-  }
+ValueObjectPrinter::ValueObjectPrinter(ValueObject &valobj, Stream *s)
----------------
jimingham wrote:

For this series of crashes,  the EXC_BAD_ACCESS address is the correct offset 
for the ivar being accessed.  So the address of the ValueObject pointer has to 
be 0x0.  If the pointer had gotten freed, the printer's pointer value wouldn't 
change, so the access would just be some random looking address.

Also, see the more general comment about uses of the ValueObjectPrinter.

https://github.com/llvm/llvm-project/pull/81314
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to