aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/core.cpp
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-06 20:03:57 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-06 20:03:57 +0100
commit9634200c1041eca1c7ac0ce25d79bb8d961530f6 (patch)
tree4e533a614caeda557d68e07754a5f97de55aa50e /qtmips_machine/core.cpp
parent16a9ee3b5ef4cbeb3a43bb0b4e243c655e6da761 (diff)
downloadqtmips-9634200c1041eca1c7ac0ce25d79bb8d961530f6.tar.gz
qtmips-9634200c1041eca1c7ac0ce25d79bb8d961530f6.tar.bz2
qtmips-9634200c1041eca1c7ac0ce25d79bb8d961530f6.zip
Resolve some memory leaks found by Valgrind.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/core.cpp')
-rw-r--r--qtmips_machine/core.cpp3
1 files changed, 2 insertions, 1 deletions
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;