[Lldb-commits] [PATCH] D58946: [SBAPI] Don't check IsValid in constructor

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Mar 4 18:01:50 PST 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: labath, davide, jingham.
JDevlieghere added a project: LLDB.
Herald added a subscriber: abidh.

When running the test suite with the instrumentation macros, I noticed two lldb-mi tests regressed. The issue was the copy constructor of SBLineEntry. Without the macros the returned value would be elided, but with the macros the copy constructor was called. The latter used `IsValid` to determine whether the underlying opaque pointer should be set. This is likely a remnant of when IsValid would only check the validity of the smart pointer. In SBLineEntry however, it actually forwards to LineEntry::IsValid().

So what happened here was that because of the macros the copy constructor was called. The opaque pointer was valid but the LineEntry didn't consider itself valid. So the copied-to object was default initialized.

This patch replaces all checks for IsValid in copy (assignment) constructors with checks for the opaque pointer itself.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D58946

Files:
  lldb/source/API/SBAddress.cpp
  lldb/source/API/SBDeclaration.cpp
  lldb/source/API/SBError.cpp
  lldb/source/API/SBExpressionOptions.cpp
  lldb/source/API/SBLineEntry.cpp
  lldb/source/API/SBProcessInfo.cpp
  lldb/source/API/SBStringList.cpp
  lldb/source/API/SBSymbolContext.cpp
  lldb/source/API/SBTypeEnumMember.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D58946.189252.patch
Type: text/x-patch
Size: 10386 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190305/a6ab64fd/attachment.bin>


More information about the lldb-commits mailing list