<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/64319>64319</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            ASAN on arm64 windows builds but crashes because SANITIZER_WINDOWS64 is used to do x86_64 instruction parsing
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          farzonl
      </td>
    </tr>
</table>

<pre>
    For context you can build asan for arm64 however it asserts in `GetInstructionSize` because it can't parse the arm instructions.

![asan_build](https://github.com/llvm/llvm-project/assets/1802579/2eed3481-efe1-4786-aee3-a04d9ef58191)

`SANITIZER_WINDOWS64` as defined should only be used to determine if we are working on a 32bit or 64bit operating system. 
https://github.com/llvm/llvm-project/blob/145a9290c2ecee0eb43964ec13bcc080d4db6030/compiler-rt/lib/sanitizer_common/sanitizer_platform.h#L114-L118

However, in practice it is being used to parse x86_64 instructions.
https://github.com/llvm/llvm-project/blob/145a9290c2ecee0eb43964ec13bcc080d4db6030/compiler-rt/lib/interception/interception_win.cpp#L459-L486


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzElEtv4zYUhX8NvbmwQVIULS608DR1GyBIgabAAN0YfFxZbCVSIKnxJL--oNLMo8hmVt2Iel3pfPeeQ52zvwbEnrQfSHu302sZY-oHnV5imHYmuuf-HBPYGAp-LvAcV7A6gFn95EBnHWCICXSapYAx3vATJvAFdM6YSgYfgEj6C5b7kEtabfExPPkXJJKCQavXjPV1qwPhxwKLThmhjFi_CP5rTT4Qekfo6d8jZ6T9UP9-2YSQ9o7wbixlyaQ5EX4m_Hz1ZVzNwcaZ8PM0fXpb9kuKf6EthJ-ryJIJP7OO8vaoCD9zRNeIju1xQLYXx07uNWKz11Q4hUPbMcUIV9-JkfTp9Hj_x_2fP_9--Xj_ePfbxycpKqDO4HDwAR3kMa6TgximZzAIa0YHJYLDgmn2AcEPcKvUCLeY_vbhCjGAhoYbXyAmkGI7WTDpUp_m51xwPsCrhh9GN1M0FVy0WnFFLUeLSNGIRkmBljXGWtpRJ5yRtKGEn22cFz9h2qdaP_lannXwxb9gutg4zzF8d2uZdBlimg8j4c0DY2L_wFj3bed-ffUL4T9VnyxJ2-Lt5gefwWDFfGvUqzE-d_IixXu--J8a4EPBZHGpUv5zebn5cLDLUuFFq_YPopPfwu9c3zjVKL3DnklFVUOlbHdjr1rVMM2pEm6g0iBXHAfbHpl2zSC02fmeU97QjjLO26NoD-zYckPNsROOD4MaiKA4az8dKvMhpuvO57xiL0XD1G7SBqf8FvjUb40x6zUTQSefS_5aVnyZsD89nR43N24hv_ng4i2_7gB1KWCTziPmL4F-Jw51ol9MH98Z5DZhH667NU39D09z46tJ3hD_CQAA__8cRI6I">