[Lldb-commits] [PATCH] D62425: [DWARFExpression] Remove ctor that takes just a compile unit.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 27 00:12:25 PDT 2019


labath added inline comments.


================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:508-509
               uint32_t block_length = form_value.Unsigned();
-              frame_base->SetOpcodeData(module, debug_info_data, block_offset,
-                                        block_length);
+              frame_base = new (frame_base) DWARFExpression(
+                  module, debug_info_data, cu, block_offset, block_length);
             } else {
----------------
This is not the copy assignment constructor. That would be something like:
`*frame_base = DWARFExpression(...)`.
This code looks pretty dodgy, as you're trampling over an already constructed object. I'm not sure whether that in itself is UB, but it definitely is not a good idea.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62425/new/

https://reviews.llvm.org/D62425





More information about the lldb-commits mailing list