aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerban Constantinescu <serban.constantinescu@arm.com>2015-04-01 16:59:09 +0100
committerSerban Constantinescu <serban.constantinescu@arm.com>2015-04-02 13:21:00 +0100
commitf83765e26812f0d09307defe5dcbabb19632ab45 (patch)
tree27fbc6ec3d09e40bac4db50482936371736be765
parent0cc8b6ece4b3e757e11a906a81ece292437713ab (diff)
downloadvixl-f83765e26812f0d09307defe5dcbabb19632ab45.tar.gz
Fix issues spotted by Valgrindandroid-wear-5.1.1_r1android-wear-5.1.0_r1
This patch has been merged into VIXL upstream(github). Change-Id: I98e3bbd5fe06db8adf8a12f35fef2b0528915532 Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
-rw-r--r--src/vixl/a64/debugger-a64.cc5
-rw-r--r--src/vixl/a64/debugger-a64.h1
-rw-r--r--src/vixl/a64/disasm-a64.h1
-rw-r--r--src/vixl/a64/macro-assembler-a64.cc9
-rw-r--r--src/vixl/a64/macro-assembler-a64.h3
-rw-r--r--src/vixl/a64/simulator-a64.cc4
-rw-r--r--test/test-assembler-a64.cc8
-rw-r--r--test/test-disasm-a64.cc2
-rw-r--r--test/test-simulator-a64.cc5
9 files changed, 30 insertions, 8 deletions
diff --git a/src/vixl/a64/debugger-a64.cc b/src/vixl/a64/debugger-a64.cc
index 1a65bd39..2c291591 100644
--- a/src/vixl/a64/debugger-a64.cc
+++ b/src/vixl/a64/debugger-a64.cc
@@ -533,6 +533,11 @@ Debugger::Debugger(Decoder* decoder, FILE* stream)
printer_->AppendVisitor(disasm_);
}
+Debugger::~Debugger() {
+ delete disasm_;
+ delete printer_;
+}
+
void Debugger::Run() {
pc_modified_ = false;
diff --git a/src/vixl/a64/debugger-a64.h b/src/vixl/a64/debugger-a64.h
index aecd6207..f26d5eb6 100644
--- a/src/vixl/a64/debugger-a64.h
+++ b/src/vixl/a64/debugger-a64.h
@@ -54,6 +54,7 @@ class FormatToken;
class Debugger : public Simulator {
public:
explicit Debugger(Decoder* decoder, FILE* stream = stdout);
+ ~Debugger();
virtual void Run();
virtual void VisitException(const Instruction* instr);
diff --git a/src/vixl/a64/disasm-a64.h b/src/vixl/a64/disasm-a64.h
index e2031564..930df6ea 100644
--- a/src/vixl/a64/disasm-a64.h
+++ b/src/vixl/a64/disasm-a64.h
@@ -165,7 +165,6 @@ class Disassembler: public DecoderVisitor {
class PrintDisassembler: public Disassembler {
public:
explicit PrintDisassembler(FILE* stream) : stream_(stream) { }
- virtual ~PrintDisassembler() { }
protected:
virtual void ProcessOutput(const Instruction* instr);
diff --git a/src/vixl/a64/macro-assembler-a64.cc b/src/vixl/a64/macro-assembler-a64.cc
index 49218b49..6921e60c 100644
--- a/src/vixl/a64/macro-assembler-a64.cc
+++ b/src/vixl/a64/macro-assembler-a64.cc
@@ -44,7 +44,8 @@ void Pool::SetNextCheckpoint(ptrdiff_t checkpoint) {
LiteralPool::LiteralPool(MacroAssembler* masm)
- : Pool(masm), size_(0), first_use_(-1) {
+ : Pool(masm), size_(0), first_use_(-1),
+ recommended_checkpoint_(kNoCheckpointRequired) {
}
@@ -277,7 +278,8 @@ MacroAssembler::MacroAssembler(size_t capacity,
tmp_list_(ip0, ip1),
fptmp_list_(d31),
literal_pool_(this),
- veneer_pool_(this) {
+ veneer_pool_(this),
+ recommended_checkpoint_(Pool::kNoCheckpointRequired) {
checkpoint_ = NextCheckPoint();
}
@@ -293,7 +295,8 @@ MacroAssembler::MacroAssembler(byte * buffer,
tmp_list_(ip0, ip1),
fptmp_list_(d31),
literal_pool_(this),
- veneer_pool_(this) {
+ veneer_pool_(this),
+ recommended_checkpoint_(Pool::kNoCheckpointRequired) {
checkpoint_ = NextCheckPoint();
}
diff --git a/src/vixl/a64/macro-assembler-a64.h b/src/vixl/a64/macro-assembler-a64.h
index e94933c7..fe389538 100644
--- a/src/vixl/a64/macro-assembler-a64.h
+++ b/src/vixl/a64/macro-assembler-a64.h
@@ -60,7 +60,8 @@ class UseScratchRegisterScope;
class Pool {
public:
- explicit Pool(MacroAssembler* masm) : masm_(masm) {
+ explicit Pool(MacroAssembler* masm)
+ : checkpoint_(kNoCheckpointRequired), masm_(masm) {
Reset();
}
diff --git a/src/vixl/a64/simulator-a64.cc b/src/vixl/a64/simulator-a64.cc
index 79256bb3..13f208fe 100644
--- a/src/vixl/a64/simulator-a64.cc
+++ b/src/vixl/a64/simulator-a64.cc
@@ -64,6 +64,8 @@ Simulator::Simulator(Decoder* decoder, FILE* stream) {
VIXL_ASSERT((static_cast<int32_t>(-1) >> 1) == -1);
VIXL_ASSERT((static_cast<uint32_t>(-1) >> 1) == 0x7fffffff);
+ instruction_stats_ = false;
+
// Set up the decoder.
decoder_ = decoder;
decoder_->AppendVisitor(this);
@@ -121,7 +123,7 @@ void Simulator::ResetState() {
Simulator::~Simulator() {
- delete [] stack_;
+ delete[] stack_;
// The decoder may outlive the simulator.
decoder_->RemoveVisitor(print_disasm_);
delete print_disasm_;
diff --git a/test/test-assembler-a64.cc b/test/test-assembler-a64.cc
index 55e42abc..ab475d0c 100644
--- a/test/test-assembler-a64.cc
+++ b/test/test-assembler-a64.cc
@@ -15134,6 +15134,8 @@ TEST(clrex) {
ASSERT_EQUAL_64(0, data[0]);
ASSERT_EQUAL_64(0, data[1]);
ASSERT_EQUAL_64(0, data[2]);
+
+ TEARDOWN();
}
@@ -15215,6 +15217,8 @@ TEST(ldxr_stxr_fail) {
// Check that the watchdog counter didn't run out.
ASSERT_EQUAL_64(0, x12);
+
+ TEARDOWN();
}
#endif
@@ -15297,6 +15301,8 @@ TEST(ldaxr_stlxr_fail) {
// Check that the watchdog counter didn't run out.
ASSERT_EQUAL_64(0, x12);
+
+ TEARDOWN();
}
#endif
@@ -15937,7 +15943,7 @@ TEST(branch_tagged_and_adr_adrp) {
ASSERT_EQUAL_64(1 << kAddressTagWidth, x1);
- TEARDOWN();
+ TEARDOWN_CUSTOM();
}
TEST(neon_3same_addp) {
diff --git a/test/test-disasm-a64.cc b/test/test-disasm-a64.cc
index 036d7557..0f54288c 100644
--- a/test/test-disasm-a64.cc
+++ b/test/test-disasm-a64.cc
@@ -102,7 +102,7 @@
delete disasm; \
delete decoder; \
delete masm; \
- delete buf
+ delete[] buf
namespace vixl {
diff --git a/test/test-simulator-a64.cc b/test/test-simulator-a64.cc
index b83642ce..f2636600 100644
--- a/test/test-simulator-a64.cc
+++ b/test/test-simulator-a64.cc
@@ -2484,6 +2484,11 @@ static void TestOpImmOpImmNEON(const char * name,
CALL_TEST_FP_HELPER(mnemonic, s, type, kInputFloat##input); \
}
+// TODO: Test with a newer version of valgrind.
+//
+// Note: valgrind-3.10.0 does not properly interpret libm's fma() on x86_64.
+// Therefore this test will be exiting though an ASSERT and thus leaking
+// memory.
DEFINE_TEST_FP(fmadd, 3Op, Basic)
DEFINE_TEST_FP(fmsub, 3Op, Basic)
DEFINE_TEST_FP(fnmadd, 3Op, Basic)