From 9634200c1041eca1c7ac0ce25d79bb8d961530f6 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 6 Feb 2019 20:03:57 +0100 Subject: Resolve some memory leaks found by Valgrind. Signed-off-by: Pavel Pisa --- qtmips_machine/core.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'qtmips_machine/core.cpp') diff --git a/qtmips_machine/core.cpp b/qtmips_machine/core.cpp index 3118d01..fb3db5c 100644 --- a/qtmips_machine/core.cpp +++ b/qtmips_machine/core.cpp @@ -233,7 +233,7 @@ void Core::writeback(const struct dtMemory &dt) { } void Core::handle_pc(const struct dtDecode &dt) { - bool branch; + bool branch = false; emit instruction_program_counter(dt.inst); if (dt.jump) { @@ -289,6 +289,7 @@ void Core::dtDecodeInit(struct dtDecode &dt) { dt.forward_m_d_rs = false; dt.forward_m_d_rt = false; dt.aluop = ALU_OP_SLL; + dt.memctl = AC_NONE; dt.val_rs = 0; dt.val_rt = 0; dt.rwrite = 0; -- cgit v1.2.3