aboutsummaryrefslogtreecommitdiff
path: root/src/long_mode/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/long_mode/display.rs')
-rw-r--r--src/long_mode/display.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs
index 107eb94..e60645b 100644
--- a/src/long_mode/display.rs
+++ b/src/long_mode/display.rs
@@ -3400,7 +3400,13 @@ fn contextualize_intel<T: fmt::Write, Y: YaxColors>(instr: &Instruction, colors:
}
}
} else {
- Operand::from_spec(instr, instr.operands[i as usize - 1]).width() / instr.mem_size
+ // this should never be `None` - that would imply two
+ // memory operands for a broadcasted operation.
+ if let Some(width) = Operand::from_spec(instr, instr.operands[i as usize - 1]).width() {
+ width / instr.mem_size
+ } else {
+ 0
+ }
};
write!(out, "{{1to{}}}", scale)?;
}