summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-05-10 15:00:40 -0400
committerbd <bdunahu@operationnull.com>2025-05-10 15:00:40 -0400
commita29d974ac8cec5803dd9c9ea66f3ac5d06a1fe2b (patch)
tree74706d0282b597abae051e611bb7e2b7038b9a00
parentb384a584f5feaa05b77d7979cce9dad500bd1e2e (diff)
Fix other instances of the same bug
-rw-r--r--src/id.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/id.cc b/src/id.cc
index ebf6db6..430bf09 100644
--- a/src/id.cc
+++ b/src/id.cc
@@ -235,8 +235,8 @@ void ID::decode_I_type(signed int &s1)
r1 = this->read_guard(s1);
this->curr_instr->operands.integer.slot_one = s1;
if (r1 == OK) {
- this->write_guard<int>(s2);
- this->curr_instr->operands.integer.slot_two = s2;
+ this->curr_instr->operands.integer.slot_two =
+ this->write_guard<int>(s2);
}
this->status = r1;
}
@@ -264,8 +264,9 @@ void ID::decode_J_type(signed int &s1)
r2 = (this->is_checked_out(s3)) ? STALLED
: OK; // we read the stack pointer
if (r1 == OK && r2 == OK) {
- this->write_guard<int>(s3); // we write the stack pointer
- this->curr_instr->operands.integer.slot_three = s3;
+ // we write the stack pointer
+ this->curr_instr->operands.integer.slot_three =
+ this->write_guard<int>(s3);
}
this->status = (r1 == OK && r2 == OK) ? OK : STALLED;
break;
@@ -277,10 +278,11 @@ void ID::decode_J_type(signed int &s1)
r1 = (this->is_checked_out(s3)) ? STALLED
: OK; // we read the stack pointer
if (r1 == OK) {
- this->write_guard<int>(s2);
- this->curr_instr->operands.integer.slot_two = s2;
- this->write_guard<int>(s3); // we write the stack pointer
- this->curr_instr->operands.integer.slot_three = s3;
+ this->curr_instr->operands.integer.slot_two =
+ this->write_guard<int>(s2);
+ // we write the stack pointer
+ this->curr_instr->operands.integer.slot_three =
+ this->write_guard<int>(s3);
}
this->status = r1;
break;