summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2026-11-09 16:38:13 +1300
committerBen Bridle <ben@derelict.engineering>2026-11-09 16:38:13 +1300
commit255fd76c527026387b0f074d5a3f9808037ca449 (patch)
treea57309501ab8af308b07b914d290d2ee0b232bd8
parentb469d0595321c44723075632fa5414d2339cc629 (diff)
downloadtorque-asm-255fd76c527026387b0f074d5a3f9808037ca449.zip
Fix source attribution for IntermediateError::ValueTooWide
Previously, the error would be displayed with two identical attributions to the source span of the word template field, which was redundant and confusing. Now, the second attribution points instead to the source of the value being inserted into that field, which was the original intended behaviour.
-rw-r--r--src/stages/intermediate.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stages/intermediate.rs b/src/stages/intermediate.rs
index e48f31b..1a26adf 100644
--- a/src/stages/intermediate.rs
+++ b/src/stages/intermediate.rs
@@ -208,7 +208,7 @@ impl IntermediateParser {
let value_width = width(field_value);
if field.width() < value_width {
let error = IntermediateError::ValueTooWide(field.width(), value_width);
- let new_source = field_source.wrap(result.source);
+ let new_source = field_source.wrap(result.value.source);
self.errors.push(Tracked::from(error, new_source));
} else {
let mut bits_mapped = 0;