[PATCH] MCStreamer for x86_64: W64UnwindInfos must be cleared in reset()
Kai Nacke
kai at redstar.de
Mon May 6 22:54:24 PDT 2013
Hi!
Just noticed the following:
MCStreamer::reset() deletes all created W64UnwindInfos but does not
clear the vector. If you ever put something into W64UnwindInfos and
class reset then you got a double-free in the destructor.
Simple fix is to call clear() in reset(). No functional change intended.
Please review. Thanks.
Regards
Kai
-------------- next part --------------
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 4839c34..8f1895e 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -35,6 +35,7 @@ MCStreamer::~MCStreamer() {
void MCStreamer::reset() {
for (unsigned i = 0; i < getNumW64UnwindInfos(); ++i)
delete W64UnwindInfos[i];
+ W64UnwindInfos.clear();
EmitEHFrame = true;
EmitDebugFrame = false;
CurrentW64UnwindInfo = 0;
More information about the llvm-commits
mailing list