[compiler-rt] [win/asan] Add a test skeleton for function GetInstructionSize. (PR #116948)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 02:29:20 PST 2024


================
@@ -793,6 +793,38 @@ TEST(Interception, EmptyExportTable) {
   EXPECT_EQ(0U, FunPtr);
 }
 
+const struct InstructionSizeData_t {
+  size_t size;       // hold instruction size or 0 for failure, e.g. on control instructions
+  u8 instr[16];
+  size_t rel_offset;
+} data[] = {
+  /* sorted list */
+  {  1, { 0x50 }, 0 },  // 50 : push eax / rax
+};
+
+std::string dumpInstruction(unsigned int arrayIndex, const InstructionSizeData_t& data) {
----------------
zmodem wrote:

s/unsigned int/unsigned/ here and in the loop in the test function

https://github.com/llvm/llvm-project/pull/116948


More information about the llvm-commits mailing list