aboutsummaryrefslogtreecommitdiff
path: root/test/protected_mode
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-12-16 19:58:15 -0800
committeriximeow <me@iximeow.net>2021-12-16 20:01:26 -0800
commitf063f747c21548329170fd09fd09d391b2277aed (patch)
tree38159b9379c7f7c081554d431f78872b5a465e92 /test/protected_mode
parentcd987288f0334b9888174f4ccc2d1f564388e994 (diff)
displacements are stored as unsigned, but are functionally signed ints
so multiplying to expand EVEX compressed offsets can overflow, and that needs to be okay.
Diffstat (limited to 'test/protected_mode')
-rw-r--r--test/protected_mode/mod.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index 4b8ca8d..70dfb78 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -3077,3 +3077,9 @@ fn test_sevsnp() {
fn from_llvm() {
test_display(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01], "hreset 0x1");
}
+
+#[test]
+fn from_reports() {
+ // negative compressed evex displacements should not overflow and panic
+ test_display(&[0x62, 0xf2, 0x6d, 0xac, 0x00, 0x59, 0xa7], "vpshufb ymm3{k4}{z}, ymm2, ymmword [ecx - 0xb20]");
+}