From 5475ced630542f72847667cb89925ee2dc3cf77d Mon Sep 17 00:00:00 2001 From: 2over12 Date: Sat, 22 Jan 2022 17:02:52 -0500 Subject: [PATCH 1/2] added memory fix patch --- ports/xed/dont_call_evex_scan_when_error.patch | 13 +++++++++++++ ports/xed/portfile.cmake | 1 + 2 files changed, 14 insertions(+) create mode 100644 ports/xed/dont_call_evex_scan_when_error.patch diff --git a/ports/xed/dont_call_evex_scan_when_error.patch b/ports/xed/dont_call_evex_scan_when_error.patch new file mode 100644 index 00000000..820e5a57 --- /dev/null +++ b/ports/xed/dont_call_evex_scan_when_error.patch @@ -0,0 +1,13 @@ +diff --git a/src/dec/xed-ild.c b/src/dec/xed-ild.c +index 1960b4e..6ba91cd 100644 +--- a/src/dec/xed-ild.c ++++ b/src/dec/xed-ild.c +@@ -1447,7 +1447,7 @@ xed_instruction_length_decode(xed_decoded_inst_t* ild) + #if defined(XED_SUPPORTS_AVX512) || defined(XED_SUPPORTS_KNC) + + // evex scanner assumes it can read bytes so we must check for limit first. +- if (xed3_operand_get_out_of_bytes(ild)) ++ if (xed3_operand_get_out_of_bytes(ild) || xed3_operand_get_error(ild)) + return; + + // if we got a vex prefix (which also sucks down the opcode), diff --git a/ports/xed/portfile.cmake b/ports/xed/portfile.cmake index 9f19f141..08afa593 100644 --- a/ports/xed/portfile.cmake +++ b/ports/xed/portfile.cmake @@ -4,6 +4,7 @@ vcpkg_from_github( REF 5976632eeaaaad7890c2109d0cfaf4012eaca3b8 # 12.0.1 SHA512 9463e669cc273f55829e82d6032763221c2ba73f3c43191be847f694f6fd3609b866cc14101e8b1f88e7e44f04b4f5f7bf61bb9431b72b7e17ded1db34b7757d HEAD_REF master + PATCHES dont_call_evex_scan_when_error.patch ) # Last checked Dec 9, 2020 From 51c5041c1a400ec0c6001e53c56167d54a9d4a36 Mon Sep 17 00:00:00 2001 From: 2over12 Date: Sat, 22 Jan 2022 17:03:21 -0500 Subject: [PATCH 2/2] fix format --- ports/xed/portfile.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/xed/portfile.cmake b/ports/xed/portfile.cmake index 08afa593..4b261bb6 100644 --- a/ports/xed/portfile.cmake +++ b/ports/xed/portfile.cmake @@ -4,7 +4,8 @@ vcpkg_from_github( REF 5976632eeaaaad7890c2109d0cfaf4012eaca3b8 # 12.0.1 SHA512 9463e669cc273f55829e82d6032763221c2ba73f3c43191be847f694f6fd3609b866cc14101e8b1f88e7e44f04b4f5f7bf61bb9431b72b7e17ded1db34b7757d HEAD_REF master - PATCHES dont_call_evex_scan_when_error.patch + PATCHES + dont_call_evex_scan_when_error.patch ) # Last checked Dec 9, 2020