<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/153829>153829</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Hexagon] Crash when trying to disassemble Y4_crswap10
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
s-barannikov
</td>
</tr>
</table>
<pre>
`echo "0x00 0xc0 0x8e 0x6d" | llvm-mc -triple=hexagon -disassemble -debug`
```
Args: cmake-build-debug/bin/llvm-mc -triple=hexagon -disassemble -debug
0: OPC_ExtractField(28, 4): 6
3: OPC_FilterValue(0, 4) FAIL: continuing at 7
11: OPC_FilterValue(1, 1003) FAIL: continuing at 15
1018: OPC_FilterValue(2, 815) FAIL: continuing at 1022
1837: OPC_FilterValue(3, 1068) FAIL: continuing at 1841
2909: OPC_FilterValue(4, 930) FAIL: continuing at 2913
3843: OPC_FilterValue(5, 653) FAIL: continuing at 3847
4500: OPC_FilterValue(6, 1312) PASS: continuing at 4504
4504: OPC_ExtractField(23, 5): 27
4507: OPC_FilterValue(0, 41) FAIL: continuing at 4511
4552: OPC_FilterValue(1, 61) FAIL: continuing at 4556
4617: OPC_FilterValue(2, 59) FAIL: continuing at 4621
4680: OPC_FilterValue(3, 59) FAIL: continuing at 4684
4743: OPC_FilterValue(4, 112) FAIL: continuing at 4747
4859: OPC_FilterValue(6, 25) FAIL: continuing at 4863
4888: OPC_FilterValue(8, 94) FAIL: continuing at 4892
4986: OPC_FilterValue(9, 51) FAIL: continuing at 4990
5041: OPC_FilterValue(10, 25) FAIL: continuing at 5045
5070: OPC_FilterValue(12, 25) FAIL: continuing at 5074
5099: OPC_FilterValue(14, 12) FAIL: continuing at 5103
5115: OPC_FilterValue(16, 25) FAIL: continuing at 5119
5144: OPC_FilterValue(18, 33) FAIL: continuing at 5148
5181: OPC_FilterValue(19, 49) FAIL: continuing at 5185
5234: OPC_FilterValue(20, 45) FAIL: continuing at 5238
5283: OPC_FilterValue(22, 159) FAIL: continuing at 5287
5446: OPC_FilterValue(23, 117) FAIL: continuing at 5450
5567: OPC_FilterValue(24, 134) FAIL: continuing at 5571
5705: OPC_FilterValue(25, 53) FAIL: continuing at 5709
5762: OPC_FilterValue(26, 12) FAIL: continuing at 5766
5778: OPC_FilterValue(27, 12) PASS: continuing at 5782
5782: OPC_CheckFieldOrFail(21, 2, 0, 0): FieldValue = 0, ExpectedValue = 0: PASS
5786: OPC_CheckFieldOrFail(0, 14, 0, 0): FieldValue = 0, ExpectedValue = 0: PASS
5790: OPC_Decode: opcode 3346, using decoder 88: PASS
llvm-mc: ../llvm/include/llvm/ADT/SmallVector.h:296: llvm::SmallVectorTemplateCommon::const_reference llvm::SmallVectorTemplateCommon<llvm::MCOperand>::operator[](llvm::SmallVectorTemplateCommon::size_type) const [T = llvm::MCOperand]: Assertion `idx < size()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: cmake-build-debug/bin/llvm-mc -triple=hexagon -disassemble -debug
#0 0x0000712b058ab9fd llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Support/Unix/Signals.inc:834:11
#1 0x0000712b058abf7b PrintStackTraceSignalHandler(void*) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Support/Unix/Signals.inc:918:1
#2 0x0000712b058a9ca6 llvm::sys::RunSignalHandlers() /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Support/Signals.cpp:104:5
#3 0x0000712b058ac77d SignalHandler(int, siginfo_t*, void*) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Support/Unix/Signals.inc:426:38
#4 0x0000712b04c42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#5 0x0000712b04c969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x0000712b04c969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#7 0x0000712b04c969fc pthread_kill ./nptl/pthread_kill.c:89:10
#8 0x0000712b04c42476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#9 0x0000712b04c287f3 abort ./stdlib/abort.c:81:7
#10 0x0000712b04c2871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x0000712b04c39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#12 0x0000712b05f8eb79 llvm::SmallVectorTemplateCommon<llvm::MCOperand, void>::operator[](unsigned long) const /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/include/llvm/ADT/SmallVector.h:0:5
#13 0x0000712b05f8e9e1 llvm::MCInst::getOperand(unsigned int) const /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/include/llvm/MC/MCInst.h:210:51
#14 0x0000712b05fa7808 llvm::HexagonMCChecker::init(llvm::MCInst const&) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp:99:13
#15 0x0000712b05fa7749 llvm::HexagonMCChecker::init() /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp:56:5
#16 0x0000712b05fa8540 llvm::HexagonMCChecker::HexagonMCChecker(llvm::MCContext&, llvm::MCInstrInfo const&, llvm::MCSubtargetInfo const&, llvm::MCInst&, llvm::MCRegisterInfo const&, bool) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp:203:1
#17 0x0000712b0619c7eb (anonymous namespace)::HexagonDisassembler::makeBundle(llvm::ArrayRef<unsigned char>, unsigned long, unsigned long&, llvm::raw_ostream&) const /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp:218:16
#18 0x0000712b0619c450 (anonymous namespace)::HexagonDisassembler::getInstructionBundle(llvm::MCInst&, unsigned long&, llvm::ArrayRef<unsigned char>, unsigned long, llvm::raw_ostream&) const /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp:259:7
#19 0x00005fa30bf0e6eb getInstruction(llvm::MCDisassembler const&, llvm::MCSubtargetInfo const&, llvm::MCInst&, unsigned long&, llvm::ArrayRef<unsigned char>, unsigned long) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/tools/llvm-mc/Disassembler.cpp:42:5
#20 0x00005fa30bf0e2b7 printInsts(llvm::MCDisassembler const&, std::pair<std::vector<unsigned char, std::allocator<unsigned char>>, std::vector<char const*, std::allocator<char const*>>> const&, llvm::SourceMgr&, llvm::MCStreamer&, bool, llvm::MCSubtargetInfo const&, unsigned int) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/tools/llvm-mc/Disassembler.cpp:57:34
#21 0x00005fa30bf0da2c llvm::Disassembler::disassemble(llvm::Target const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, llvm::MCSubtargetInfo&, llvm::MCStreamer&, llvm::MemoryBuffer&, llvm::SourceMgr&, llvm::MCContext&, llvm::MCTargetOptions const&, bool, unsigned int) /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/tools/llvm-mc/Disassembler.cpp:228:24
#22 0x00005fa30beeb4ef main /home/sergei/Projects/llvm-project/cmake-build-debug/../llvm/tools/llvm-mc/llvm-mc.cpp:655:9
#23 0x0000712b04c29d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#24 0x0000712b04c29e40 call_init ./csu/../csu/libc-start.c:128:20
#25 0x0000712b04c29e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#26 0x00005fa30bee9475 _start (cmake-build-debug/bin/llvm-mc+0x29475)
Aborted (core dumped)
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUWltv2zgW_jXMCxGDV10e8qA6MabAFA0m3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