aboutsummaryrefslogtreecommitdiff
path: root/src/protected_mode/display.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/protected_mode/display.rs')
-rw-r--r--src/protected_mode/display.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/protected_mode/display.rs b/src/protected_mode/display.rs
index 83d3b56..3e0079e 100644
--- a/src/protected_mode/display.rs
+++ b/src/protected_mode/display.rs
@@ -3414,7 +3414,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)?;
}