[llvm] r192031 - lli: Plug leaks in the remote target external implementation.
Benjamin Kramer
benny.kra at googlemail.com
Sat Oct 5 04:53:20 PDT 2013
Author: d0k
Date: Sat Oct 5 06:53:20 2013
New Revision: 192031
URL: http://llvm.org/viewvc/llvm-project?rev=192031&view=rev
Log:
lli: Plug leaks in the remote target external implementation.
Modified:
llvm/trunk/tools/lli/ChildTarget/ChildTarget.cpp
llvm/trunk/tools/lli/ChildTarget/Unix/ChildTarget.inc
llvm/trunk/tools/lli/ChildTarget/Windows/ChildTarget.inc
llvm/trunk/tools/lli/RemoteTargetExternal.h
llvm/trunk/tools/lli/Unix/RemoteTargetExternal.inc
llvm/trunk/tools/lli/Windows/RemoteTargetExternal.inc
Modified: llvm/trunk/tools/lli/ChildTarget/ChildTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/ChildTarget/ChildTarget.cpp?rev=192031&r1=192030&r2=192031&view=diff
==============================================================================
--- llvm/trunk/tools/lli/ChildTarget/ChildTarget.cpp (original)
+++ llvm/trunk/tools/lli/ChildTarget/ChildTarget.cpp Sat Oct 5 06:53:20 2013
@@ -11,6 +11,7 @@ using namespace llvm;
class LLIChildTarget {
public:
+ ~LLIChildTarget(); // OS-specific destructor
void initialize();
LLIMessageType waitForIncomingMessage();
void handleMessage(LLIMessageType messageType);
Modified: llvm/trunk/tools/lli/ChildTarget/Unix/ChildTarget.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/ChildTarget/Unix/ChildTarget.inc?rev=192031&r1=192030&r2=192031&view=diff
==============================================================================
--- llvm/trunk/tools/lli/ChildTarget/Unix/ChildTarget.inc (original)
+++ llvm/trunk/tools/lli/ChildTarget/Unix/ChildTarget.inc Sat Oct 5 06:53:20 2013
@@ -49,6 +49,10 @@ struct ConnectionData_t {
} // namespace
+LLIChildTarget::~LLIChildTarget() {
+ delete static_cast<ConnectionData_t *>(ConnectionData);
+}
+
// OS-specific methods
void LLIChildTarget::initializeConnection() {
// Store the parent ends of the pipes
Modified: llvm/trunk/tools/lli/ChildTarget/Windows/ChildTarget.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/ChildTarget/Windows/ChildTarget.inc?rev=192031&r1=192030&r2=192031&view=diff
==============================================================================
--- llvm/trunk/tools/lli/ChildTarget/Windows/ChildTarget.inc (original)
+++ llvm/trunk/tools/lli/ChildTarget/Windows/ChildTarget.inc Sat Oct 5 06:53:20 2013
@@ -12,6 +12,9 @@
//
//===----------------------------------------------------------------------===//
+LLIChildTarget::~LLIChildTarget() {
+}
+
// The RemoteTargetExternal implementation should prevent us from ever getting
// here on Windows, but nothing prevents a user from running this directly.
void LLIChildTarget::initializeConnection() {
Modified: llvm/trunk/tools/lli/RemoteTargetExternal.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/RemoteTargetExternal.h?rev=192031&r1=192030&r2=192031&view=diff
==============================================================================
--- llvm/trunk/tools/lli/RemoteTargetExternal.h (original)
+++ llvm/trunk/tools/lli/RemoteTargetExternal.h Sat Oct 5 06:53:20 2013
@@ -88,7 +88,7 @@ public:
virtual void stop();
RemoteTargetExternal(std::string &Name) : RemoteTarget(), ChildName(Name) {}
- virtual ~RemoteTargetExternal() {}
+ virtual ~RemoteTargetExternal();
private:
std::string ChildName;
Modified: llvm/trunk/tools/lli/Unix/RemoteTargetExternal.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/Unix/RemoteTargetExternal.inc?rev=192031&r1=192030&r2=192031&view=diff
==============================================================================
--- llvm/trunk/tools/lli/Unix/RemoteTargetExternal.inc (original)
+++ llvm/trunk/tools/lli/Unix/RemoteTargetExternal.inc Sat Oct 5 06:53:20 2013
@@ -89,4 +89,8 @@ void RemoteTargetExternal::Wait() {
wait(NULL);
}
+RemoteTargetExternal::~RemoteTargetExternal() {
+ delete static_cast<ConnectionData_t *>(ConnectionData);
+}
+
} // namespace llvm
Modified: llvm/trunk/tools/lli/Windows/RemoteTargetExternal.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lli/Windows/RemoteTargetExternal.inc?rev=192031&r1=192030&r2=192031&view=diff
==============================================================================
--- llvm/trunk/tools/lli/Windows/RemoteTargetExternal.inc (original)
+++ llvm/trunk/tools/lli/Windows/RemoteTargetExternal.inc Sat Oct 5 06:53:20 2013
@@ -29,4 +29,7 @@ int RemoteTargetExternal::ReadBytes(void
void RemoteTargetExternal::Wait() {
}
+RemoteTargetExternal::~RemoteTargetExternal() {
+}
+
} // namespace llvm
More information about the llvm-commits
mailing list