diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-10-05 11:53:20 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-10-05 11:53:20 +0000 |
commit | c83946f7f522c4b45d60f3bac4849f0811e18d30 (patch) | |
tree | bc4cbc0a5716de7ca54c773389931973b4d823f0 /llvm/tools | |
parent | 3c529ca9308eb1c3cc30e0df7834fef0797b1c70 (diff) | |
download | bcm5719-llvm-c83946f7f522c4b45d60f3bac4849f0811e18d30.tar.gz bcm5719-llvm-c83946f7f522c4b45d60f3bac4849f0811e18d30.zip |
lli: Plug leaks in the remote target external implementation.
llvm-svn: 192031
Diffstat (limited to 'llvm/tools')
-rw-r--r-- | llvm/tools/lli/ChildTarget/ChildTarget.cpp | 1 | ||||
-rw-r--r-- | llvm/tools/lli/ChildTarget/Unix/ChildTarget.inc | 4 | ||||
-rw-r--r-- | llvm/tools/lli/ChildTarget/Windows/ChildTarget.inc | 3 | ||||
-rw-r--r-- | llvm/tools/lli/RemoteTargetExternal.h | 2 | ||||
-rw-r--r-- | llvm/tools/lli/Unix/RemoteTargetExternal.inc | 4 | ||||
-rw-r--r-- | llvm/tools/lli/Windows/RemoteTargetExternal.inc | 3 |
6 files changed, 16 insertions, 1 deletions
diff --git a/llvm/tools/lli/ChildTarget/ChildTarget.cpp b/llvm/tools/lli/ChildTarget/ChildTarget.cpp index a59209a160c..55fcae9def8 100644 --- a/llvm/tools/lli/ChildTarget/ChildTarget.cpp +++ b/llvm/tools/lli/ChildTarget/ChildTarget.cpp @@ -11,6 +11,7 @@ using namespace llvm; class LLIChildTarget { public: + ~LLIChildTarget(); // OS-specific destructor void initialize(); LLIMessageType waitForIncomingMessage(); void handleMessage(LLIMessageType messageType); diff --git a/llvm/tools/lli/ChildTarget/Unix/ChildTarget.inc b/llvm/tools/lli/ChildTarget/Unix/ChildTarget.inc index cd42f34edd5..cc95810dc8c 100644 --- a/llvm/tools/lli/ChildTarget/Unix/ChildTarget.inc +++ b/llvm/tools/lli/ChildTarget/Unix/ChildTarget.inc @@ -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 diff --git a/llvm/tools/lli/ChildTarget/Windows/ChildTarget.inc b/llvm/tools/lli/ChildTarget/Windows/ChildTarget.inc index bb95aff000c..45db2b0a808 100644 --- a/llvm/tools/lli/ChildTarget/Windows/ChildTarget.inc +++ b/llvm/tools/lli/ChildTarget/Windows/ChildTarget.inc @@ -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() { diff --git a/llvm/tools/lli/RemoteTargetExternal.h b/llvm/tools/lli/RemoteTargetExternal.h index 9a3644ac550..a4bfad2f12f 100644 --- a/llvm/tools/lli/RemoteTargetExternal.h +++ b/llvm/tools/lli/RemoteTargetExternal.h @@ -88,7 +88,7 @@ public: virtual void stop(); RemoteTargetExternal(std::string &Name) : RemoteTarget(), ChildName(Name) {} - virtual ~RemoteTargetExternal() {} + virtual ~RemoteTargetExternal(); private: std::string ChildName; diff --git a/llvm/tools/lli/Unix/RemoteTargetExternal.inc b/llvm/tools/lli/Unix/RemoteTargetExternal.inc index e245f7e3a81..9c1a4cc3155 100644 --- a/llvm/tools/lli/Unix/RemoteTargetExternal.inc +++ b/llvm/tools/lli/Unix/RemoteTargetExternal.inc @@ -89,4 +89,8 @@ void RemoteTargetExternal::Wait() { wait(NULL); } +RemoteTargetExternal::~RemoteTargetExternal() { + delete static_cast<ConnectionData_t *>(ConnectionData); +} + } // namespace llvm diff --git a/llvm/tools/lli/Windows/RemoteTargetExternal.inc b/llvm/tools/lli/Windows/RemoteTargetExternal.inc index 6536d9974a0..aef46279455 100644 --- a/llvm/tools/lli/Windows/RemoteTargetExternal.inc +++ b/llvm/tools/lli/Windows/RemoteTargetExternal.inc @@ -29,4 +29,7 @@ int RemoteTargetExternal::ReadBytes(void *Data, size_t Size) { void RemoteTargetExternal::Wait() { } +RemoteTargetExternal::~RemoteTargetExternal() { +} + } // namespace llvm |