Skip to content

Commit

Permalink
Machine: minor diagnostic and error messages cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Pavel Pisa <[email protected]>
  • Loading branch information
ppisa committed Dec 11, 2023
1 parent f810af3 commit b1a2ad2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 7 additions & 1 deletion src/machine/instruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,13 @@ Instruction Instruction::base_from_tokens(
try {
inst_code = im->code;

if (inst.fields.count() != (int)im->args.size()) { continue; }
if (inst.fields.count() != (int)im->args.size()) {
if (!rethrow) {
parse_error = ParseError("number of arguments does not match");
rethrow = true;
}
continue;
}

for (int field_index = 0; field_index < (int)im->args.size(); field_index++) {
const QString &arg = im->args[field_index];
Expand Down
2 changes: 0 additions & 2 deletions src/machine/memory/backend/aclintmswi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ uint32_t AclintMswi::read_reg32(Offset source, AccessEffects type) const {
if ((source >= ACLINT_MSWI_OFFSET) &&
(source < ACLINT_MSWI_OFFSET + 4 * mswi_count)) {
value = mswi_value[source >> 2]? 1: 0;
} else {
printf("WARNING: ACLINT MSWI - read out of range (at 0x%lu).\n", source);
}

emit read_notification(source, value);
Expand Down
2 changes: 0 additions & 2 deletions src/machine/memory/backend/aclintmtimer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ uint64_t AclintMtimer::read_reg64(Offset source, AccessEffects type) const {
} else if ((source >= ACLINT_MTIMECMP_OFFSET) &&
(source < ACLINT_MTIMECMP_OFFSET + 8 * mtimecmp_count)) {
value = mtimecmp_value[source >> 3];
} else {
printf("WARNING: ACLINT MTIMER - read out of range (at 0x%lu).\n", source);
}

emit read_notification(source, value);
Expand Down
2 changes: 0 additions & 2 deletions src/machine/memory/backend/aclintsswi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ uint32_t AclintSswi::read_reg32(Offset source, AccessEffects type) const {

if ((source >= ACLINT_SSWI_OFFSET) &&
(source < ACLINT_SSWI_OFFSET + 4 * sswi_count)) {
} else {
printf("WARNING: ACLINT SSWI - read out of range (at 0x%lu).\n", source);
}

emit read_notification(source, value);
Expand Down

0 comments on commit b1a2ad2

Please sign in to comment.