[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
Tue May 28 08:09:46 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 {
----------------
clayborg wrote:
> labath wrote:
> > 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.
> Use move?:
> ```
> *frame_base = std::move(DWARFExpression(...));
> ```
move is not needed as `DWARFExpression(...)` is a temporary.


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

https://reviews.llvm.org/D62425





More information about the lldb-commits mailing list