diff --git a/resources/asmtext_filter_tests.ce-bug-3963.approved.txt b/resources/asmtext_filter_tests.ce-bug-3963.approved.txt index 92f2020..270056f 100644 --- a/resources/asmtext_filter_tests.ce-bug-3963.approved.txt +++ b/resources/asmtext_filter_tests.ce-bug-3963.approved.txt @@ -1 +1 @@ -{"asm": [{"labels": [], "source": null, "section": ".text", "text": "main:"},{"labels": [], "opcodes": ["55"], "address": 4198592, "source": {"file": null, "mainsource": "true", "line": 15}, "section": ".text", "text": " push rbp"},{"labels": [], "opcodes": ["ba", "0a", "00", "00", "00"], "address": 4198593, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " mov edx,0xa"},{"labels": [], "opcodes": ["31", "f6"], "address": 4198598, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " xor esi,esi"},{"labels": [], "opcodes": ["bf", "04", "20", "40", "00"], "address": 4198600, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " mov edi,0x402004"},{"labels": [], "opcodes": ["53"], "address": 4198605, "source": {"file": null, "mainsource": "true", "line": 15}, "section": ".text", "text": " push rbx"},{"labels": [], "opcodes": ["48", "83", "ec", "08"], "address": 4198606, "source": {"file": null, "mainsource": "true", "line": 15}, "section": ".text", "text": " sub rsp,0x8"},{"labels": [], "opcodes": ["e8", "a9", "ff", "ff", "ff"], "address": 4198610, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " call 401080 "},{"labels": [], "opcodes": ["bf", "80", "40", "40", "00"], "address": 4198615, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " mov edi,0x404080"},{"labels": [], "opcodes": ["89", "c6"], "address": 4198620, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " mov esi,eax"},{"labels": [], "opcodes": ["e8", "bd", "ff", "ff", "ff"], "address": 4198622, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " call 4010a0 "},{"labels": [], "opcodes": ["48", "89", "c3"], "address": 4198627, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " mov rbx,rax"},{"labels": [], "opcodes": ["48", "8b", "00"], "address": 4198630, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rax,QWORD PTR [rax]"},{"labels": [], "opcodes": ["48", "8b", "40", "e8"], "address": 4198633, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rax,QWORD PTR [rax-0x18]"},{"labels": [], "opcodes": ["48", "8b", "ac", "03", "f0", "00", "00", "00"], "address": 4198637, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rbp,QWORD PTR [rbx+rax*1+0xf0]"},{"labels": [], "opcodes": ["48", "85", "ed"], "address": 4198645, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 49}, "section": ".text", "text": " test rbp,rbp"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["74", "4f"], "address": 4198648, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 49}, "section": ".text", "text": " je 401149 "},{"labels": [], "opcodes": ["80", "7d", "38", "00"], "address": 4198650, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 882}, "section": ".text", "text": " cmp BYTE PTR [rbp+0x38],0x0"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["74", "1d"], "address": 4198654, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 882}, "section": ".text", "text": " je 40111d "},{"labels": [], "opcodes": ["0f", "be", "75", "43"], "address": 4198656, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 883}, "section": ".text", "text": " movsx esi,BYTE PTR [rbp+0x43]"},{"labels": [], "opcodes": ["48", "89", "df"], "address": 4198660, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rdi,rbx"},{"labels": [], "opcodes": ["e8", "24", "ff", "ff", "ff"], "address": 4198663, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " call 401030 "},{"labels": [], "opcodes": ["48", "89", "c7"], "address": 4198668, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rdi,rax"},{"labels": [], "opcodes": ["e8", "2c", "ff", "ff", "ff"], "address": 4198671, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 711}, "section": ".text", "text": " call 401040 "},{"labels": [], "opcodes": ["48", "83", "c4", "08"], "address": 4198676, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " add rsp,0x8"},{"labels": [], "opcodes": ["31", "c0"], "address": 4198680, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " xor eax,eax"},{"labels": [], "opcodes": ["5b"], "address": 4198682, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " pop rbx"},{"labels": [], "opcodes": ["5d"], "address": 4198683, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " pop rbp"},{"labels": [], "opcodes": ["c3"], "address": 4198684, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["48", "89", "ef"], "address": 4198685, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 884}, "section": ".text", "text": " mov rdi,rbp"},{"labels": [{"name": "char", "range": {"startCol": 28, "endCol": 32}}], "opcodes": ["e8", "3b", "ff", "ff", "ff"], "address": 4198688, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 884}, "section": ".text", "text": " call 401060 ::_M_widen_init() const@plt>"},{"labels": [], "opcodes": ["48", "8b", "45", "00"], "address": 4198693, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov rax,QWORD PTR [rbp+0x0]"},{"labels": [], "opcodes": ["be", "0a", "00", "00", "00"], "address": 4198697, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov esi,0xa"},{"labels": [], "opcodes": ["48", "8b", "40", "30"], "address": 4198702, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov rax,QWORD PTR [rax+0x30]"},{"labels": [], "opcodes": ["48", "3d", "c0", "12", "40", "00"], "address": 4198706, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " cmp rax,0x4012c0"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["74", "ca"], "address": 4198712, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " je 401104 "},{"labels": [], "opcodes": ["be", "0a", "00", "00", "00"], "address": 4198714, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov esi,0xa"},{"labels": [], "opcodes": ["48", "89", "ef"], "address": 4198719, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov rdi,rbp"},{"labels": [], "opcodes": ["ff", "d0"], "address": 4198722, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " call rax"},{"labels": [], "opcodes": ["0f", "be", "f0"], "address": 4198724, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " movsx esi,al"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["eb", "bb"], "address": 4198727, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " jmp 401104 "},{"labels": [], "opcodes": ["e8", "22", "ff", "ff", "ff"], "address": 4198729, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 50}, "section": ".text", "text": " call 401070 "},{"labels": [], "opcodes": ["66", "90"], "address": 4198734, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 50}, "section": ".text", "text": " xchg ax,ax"},{"labels": [], "address": 4198736, "source": null, "section": ".text", "text": "_GLOBAL__sub_I__Zli3_kmPKc:"},{"labels": [], "opcodes": ["48", "83", "ec", "08"], "address": 4198736, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " sub rsp,0x8"},{"labels": [], "opcodes": ["bf", "91", "41", "40", "00"], "address": 4198740, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov edi,0x404191"},{"labels": [], "opcodes": ["e8", "32", "ff", "ff", "ff"], "address": 4198745, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " call 401090 "},{"labels": [], "opcodes": ["ba", "68", "40", "40", "00"], "address": 4198750, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov edx,0x404068"},{"labels": [], "opcodes": ["be", "91", "41", "40", "00"], "address": 4198755, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov esi,0x404191"},{"labels": [], "opcodes": ["bf", "b0", "10", "40", "00"], "address": 4198760, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov edi,0x4010b0"},{"labels": [], "opcodes": ["48", "83", "c4", "08"], "address": 4198765, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " add rsp,0x8"},{"labels": [], "opcodes": ["e9", "da", "fe", "ff", "ff"], "address": 4198769, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " jmp 401050 <__cxa_atexit@plt>"},{"labels": [], "opcodes": ["66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4198774, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "source": null, "section": ".text", "text": "operator\"\" _km(char const*):"},{"labels": [], "opcodes": ["48", "83", "ec", "08"], "address": 4199024, "source": {"file": null, "mainsource": "true", "line": 7}, "section": ".text", "text": " sub rsp,0x8"},{"labels": [], "opcodes": ["ba", "0a", "00", "00", "00"], "address": 4199028, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " mov edx,0xa"},{"labels": [], "opcodes": ["31", "f6"], "address": 4199033, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " xor esi,esi"},{"labels": [], "opcodes": ["e8", "00", "fe", "ff", "ff"], "address": 4199035, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " call 401080 "},{"labels": [], "opcodes": ["48", "83", "c4", "08"], "address": 4199040, "source": {"file": null, "mainsource": "true", "line": 9}, "section": ".text", "text": " add rsp,0x8"},{"labels": [], "opcodes": ["c3"], "address": 4199044, "source": {"file": null, "mainsource": "true", "line": 9}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["66", "66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4199045, "source": {"file": null, "mainsource": "true", "line": 9}, "section": ".text", "text": " data16 cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "address": 4199056, "source": null, "section": ".text", "text": "operator\"\" _km(long double):"},{"labels": [], "opcodes": ["d9", "7c", "24", "f6"], "address": 4199056, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fnstcw WORD PTR [rsp-0xa]"},{"labels": [], "opcodes": ["db", "6c", "24", "08"], "address": 4199060, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fld TBYTE PTR [rsp+0x8]"},{"labels": [], "opcodes": ["0f", "b7", "44", "24", "f6"], "address": 4199064, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " movzx eax,WORD PTR [rsp-0xa]"},{"labels": [], "opcodes": ["80", "cc", "0c"], "address": 4199069, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " or ah,0xc"},{"labels": [], "opcodes": ["66", "89", "44", "24", "f4"], "address": 4199072, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " mov WORD PTR [rsp-0xc],ax"},{"labels": [], "opcodes": ["d9", "6c", "24", "f4"], "address": 4199077, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fldcw WORD PTR [rsp-0xc]"},{"labels": [], "opcodes": ["db", "5c", "24", "f0"], "address": 4199081, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fistp DWORD PTR [rsp-0x10]"},{"labels": [], "opcodes": ["d9", "6c", "24", "f6"], "address": 4199085, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fldcw WORD PTR [rsp-0xa]"},{"labels": [], "opcodes": ["8b", "44", "24", "f0"], "address": 4199089, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " mov eax,DWORD PTR [rsp-0x10]"},{"labels": [], "opcodes": ["c3"], "address": 4199093, "source": {"file": null, "mainsource": "true", "line": 13}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4199094, "source": {"file": null, "mainsource": "true", "line": 13}, "section": ".text", "text": " cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "address": 4199104, "source": null, "section": ".text", "text": "std::ctype::do_widen(char) const:"},{"labels": [], "opcodes": ["89", "f0"], "address": 4199104, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1092}, "section": ".text", "text": " mov eax,esi"},{"labels": [], "opcodes": ["c3"], "address": 4199106, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1093}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4199107, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1093}, "section": ".text", "text": " cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "opcodes": ["0f", "1f", "00"], "address": 4199117, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1093}, "section": ".text", "text": " nop DWORD PTR [rax]"}],"labelDefinitions": {"main": 1, "_GLOBAL__sub_I__Zli3_kmPKc": 44, "operator\"\" _km(char const*)": 54, "operator\"\" _km(long double)": 62, "std::ctype::do_widen(char) const": 74}, "filteredCount": 261} +{"asm": [{"labels": [], "source": null, "section": ".text", "text": "main:"},{"labels": [], "opcodes": ["55"], "address": 4198592, "source": {"file": null, "mainsource": "true", "line": 15}, "section": ".text", "text": " push rbp"},{"labels": [], "opcodes": ["ba", "0a", "00", "00", "00"], "address": 4198593, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " mov edx,0xa"},{"labels": [], "opcodes": ["31", "f6"], "address": 4198598, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " xor esi,esi"},{"labels": [], "opcodes": ["bf", "04", "20", "40", "00"], "address": 4198600, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " mov edi,0x402004"},{"labels": [], "opcodes": ["53"], "address": 4198605, "source": {"file": null, "mainsource": "true", "line": 15}, "section": ".text", "text": " push rbx"},{"labels": [], "opcodes": ["48", "83", "ec", "08"], "address": 4198606, "source": {"file": null, "mainsource": "true", "line": 15}, "section": ".text", "text": " sub rsp,0x8"},{"labels": [], "opcodes": ["e8", "a9", "ff", "ff", "ff"], "address": 4198610, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " call 401080 "},{"labels": [], "opcodes": ["bf", "80", "40", "40", "00"], "address": 4198615, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " mov edi,0x404080"},{"labels": [], "opcodes": ["89", "c6"], "address": 4198620, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " mov esi,eax"},{"labels": [], "opcodes": ["e8", "bd", "ff", "ff", "ff"], "address": 4198622, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " call 4010a0 "},{"labels": [], "opcodes": ["48", "89", "c3"], "address": 4198627, "source": {"file": null, "mainsource": "true", "line": 17}, "section": ".text", "text": " mov rbx,rax"},{"labels": [], "opcodes": ["48", "8b", "00"], "address": 4198630, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rax,QWORD PTR [rax]"},{"labels": [], "opcodes": ["48", "8b", "40", "e8"], "address": 4198633, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rax,QWORD PTR [rax-0x18]"},{"labels": [], "opcodes": ["48", "8b", "ac", "03", "f0", "00", "00", "00"], "address": 4198637, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rbp,QWORD PTR [rbx+rax*1+0xf0]"},{"labels": [], "opcodes": ["48", "85", "ed"], "address": 4198645, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 49}, "section": ".text", "text": " test rbp,rbp"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["74", "4f"], "address": 4198648, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 49}, "section": ".text", "text": " je 401149 "},{"labels": [], "opcodes": ["80", "7d", "38", "00"], "address": 4198650, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 882}, "section": ".text", "text": " cmp BYTE PTR [rbp+0x38],0x0"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["74", "1d"], "address": 4198654, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 882}, "section": ".text", "text": " je 40111d "},{"labels": [], "opcodes": ["0f", "be", "75", "43"], "address": 4198656, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 883}, "section": ".text", "text": " movsx esi,BYTE PTR [rbp+0x43]"},{"labels": [], "opcodes": ["48", "89", "df"], "address": 4198660, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rdi,rbx"},{"labels": [], "opcodes": ["e8", "24", "ff", "ff", "ff"], "address": 4198663, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " call 401030 "},{"labels": [], "opcodes": ["48", "89", "c7"], "address": 4198668, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 689}, "section": ".text", "text": " mov rdi,rax"},{"labels": [], "opcodes": ["e8", "2c", "ff", "ff", "ff"], "address": 4198671, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/ostream", "mainsource": "false", "line": 711}, "section": ".text", "text": " call 401040 "},{"labels": [], "opcodes": ["48", "83", "c4", "08"], "address": 4198676, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " add rsp,0x8"},{"labels": [], "opcodes": ["31", "c0"], "address": 4198680, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " xor eax,eax"},{"labels": [], "opcodes": ["5b"], "address": 4198682, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " pop rbx"},{"labels": [], "opcodes": ["5d"], "address": 4198683, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " pop rbp"},{"labels": [], "opcodes": ["c3"], "address": 4198684, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["48", "89", "ef"], "address": 4198685, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 884}, "section": ".text", "text": " mov rdi,rbp"},{"labels": [], "opcodes": ["e8", "3b", "ff", "ff", "ff"], "address": 4198688, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 884}, "section": ".text", "text": " call 401060 ::_M_widen_init() const@plt>"},{"labels": [], "opcodes": ["48", "8b", "45", "00"], "address": 4198693, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov rax,QWORD PTR [rbp+0x0]"},{"labels": [], "opcodes": ["be", "0a", "00", "00", "00"], "address": 4198697, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov esi,0xa"},{"labels": [], "opcodes": ["48", "8b", "40", "30"], "address": 4198702, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov rax,QWORD PTR [rax+0x30]"},{"labels": [], "opcodes": ["48", "3d", "c0", "12", "40", "00"], "address": 4198706, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " cmp rax,0x4012c0"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["74", "ca"], "address": 4198712, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " je 401104 "},{"labels": [], "opcodes": ["be", "0a", "00", "00", "00"], "address": 4198714, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov esi,0xa"},{"labels": [], "opcodes": ["48", "89", "ef"], "address": 4198719, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " mov rdi,rbp"},{"labels": [], "opcodes": ["ff", "d0"], "address": 4198722, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " call rax"},{"labels": [], "opcodes": ["0f", "be", "f0"], "address": 4198724, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " movsx esi,al"},{"labels": [{"name": "main", "range": {"startCol": 17, "endCol": 21}}], "opcodes": ["eb", "bb"], "address": 4198727, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 885}, "section": ".text", "text": " jmp 401104 "},{"labels": [], "opcodes": ["e8", "22", "ff", "ff", "ff"], "address": 4198729, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 50}, "section": ".text", "text": " call 401070 "},{"labels": [], "opcodes": ["66", "90"], "address": 4198734, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/basic_ios.h", "mainsource": "false", "line": 50}, "section": ".text", "text": " xchg ax,ax"},{"labels": [], "address": 4198736, "source": null, "section": ".text", "text": "_GLOBAL__sub_I__Zli3_kmPKc:"},{"labels": [], "opcodes": ["48", "83", "ec", "08"], "address": 4198736, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " sub rsp,0x8"},{"labels": [], "opcodes": ["bf", "91", "41", "40", "00"], "address": 4198740, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov edi,0x404191"},{"labels": [], "opcodes": ["e8", "32", "ff", "ff", "ff"], "address": 4198745, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " call 401090 "},{"labels": [], "opcodes": ["ba", "68", "40", "40", "00"], "address": 4198750, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov edx,0x404068"},{"labels": [], "opcodes": ["be", "91", "41", "40", "00"], "address": 4198755, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov esi,0x404191"},{"labels": [], "opcodes": ["bf", "b0", "10", "40", "00"], "address": 4198760, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " mov edi,0x4010b0"},{"labels": [], "opcodes": ["48", "83", "c4", "08"], "address": 4198765, "source": {"file": null, "mainsource": "true", "line": 18}, "section": ".text", "text": " add rsp,0x8"},{"labels": [], "opcodes": ["e9", "da", "fe", "ff", "ff"], "address": 4198769, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " jmp 401050 <__cxa_atexit@plt>"},{"labels": [], "opcodes": ["66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4198774, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/iostream", "mainsource": "false", "line": 74}, "section": ".text", "text": " cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "source": null, "section": ".text", "text": "operator\"\" _km(char const*):"},{"labels": [], "opcodes": ["48", "83", "ec", "08"], "address": 4199024, "source": {"file": null, "mainsource": "true", "line": 7}, "section": ".text", "text": " sub rsp,0x8"},{"labels": [], "opcodes": ["ba", "0a", "00", "00", "00"], "address": 4199028, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " mov edx,0xa"},{"labels": [], "opcodes": ["31", "f6"], "address": 4199033, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " xor esi,esi"},{"labels": [], "opcodes": ["e8", "00", "fe", "ff", "ff"], "address": 4199035, "source": {"file": "/usr/include/stdlib.h", "mainsource": "false", "line": 363}, "section": ".text", "text": " call 401080 "},{"labels": [], "opcodes": ["48", "83", "c4", "08"], "address": 4199040, "source": {"file": null, "mainsource": "true", "line": 9}, "section": ".text", "text": " add rsp,0x8"},{"labels": [], "opcodes": ["c3"], "address": 4199044, "source": {"file": null, "mainsource": "true", "line": 9}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["66", "66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4199045, "source": {"file": null, "mainsource": "true", "line": 9}, "section": ".text", "text": " data16 cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "address": 4199056, "source": null, "section": ".text", "text": "operator\"\" _km(long double):"},{"labels": [], "opcodes": ["d9", "7c", "24", "f6"], "address": 4199056, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fnstcw WORD PTR [rsp-0xa]"},{"labels": [], "opcodes": ["db", "6c", "24", "08"], "address": 4199060, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fld TBYTE PTR [rsp+0x8]"},{"labels": [], "opcodes": ["0f", "b7", "44", "24", "f6"], "address": 4199064, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " movzx eax,WORD PTR [rsp-0xa]"},{"labels": [], "opcodes": ["80", "cc", "0c"], "address": 4199069, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " or ah,0xc"},{"labels": [], "opcodes": ["66", "89", "44", "24", "f4"], "address": 4199072, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " mov WORD PTR [rsp-0xc],ax"},{"labels": [], "opcodes": ["d9", "6c", "24", "f4"], "address": 4199077, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fldcw WORD PTR [rsp-0xc]"},{"labels": [], "opcodes": ["db", "5c", "24", "f0"], "address": 4199081, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fistp DWORD PTR [rsp-0x10]"},{"labels": [], "opcodes": ["d9", "6c", "24", "f6"], "address": 4199085, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " fldcw WORD PTR [rsp-0xa]"},{"labels": [], "opcodes": ["8b", "44", "24", "f0"], "address": 4199089, "source": {"file": null, "mainsource": "true", "line": 12}, "section": ".text", "text": " mov eax,DWORD PTR [rsp-0x10]"},{"labels": [], "opcodes": ["c3"], "address": 4199093, "source": {"file": null, "mainsource": "true", "line": 13}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4199094, "source": {"file": null, "mainsource": "true", "line": 13}, "section": ".text", "text": " cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "address": 4199104, "source": null, "section": ".text", "text": "std::ctype::do_widen(char) const:"},{"labels": [], "opcodes": ["89", "f0"], "address": 4199104, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1092}, "section": ".text", "text": " mov eax,esi"},{"labels": [], "opcodes": ["c3"], "address": 4199106, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1093}, "section": ".text", "text": " ret "},{"labels": [], "opcodes": ["66", "2e", "0f", "1f", "84", "00", "00", "00", "00", "00"], "address": 4199107, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1093}, "section": ".text", "text": " cs nop WORD PTR [rax+rax*1+0x0]"},{"labels": [], "opcodes": ["0f", "1f", "00"], "address": 4199117, "source": {"file": "/opt/compiler-explorer/gcc-trunk-20220526/include/c++/13.0.0/bits/locale_facets.h", "mainsource": "false", "line": 1093}, "section": ".text", "text": " nop DWORD PTR [rax]"}],"labelDefinitions": {"main": 1, "_GLOBAL__sub_I__Zli3_kmPKc": 44, "operator\"\" _km(char const*)": 54, "operator\"\" _km(long double)": 62, "std::ctype::do_widen(char) const": 74}, "filteredCount": 261} diff --git a/resources/asmtext_filter_tests.ce-bug-8809.approved.txt b/resources/asmtext_filter_tests.ce-bug-8809.approved.txt new file mode 100644 index 0000000..5de41c5 --- /dev/null +++ b/resources/asmtext_filter_tests.ce-bug-8809.approved.txt @@ -0,0 +1 @@ +{"asm": [{"labels": [], "source": null, "section": ".text", "text": "main:"},{"labels": [], "opcodes": ["55"], "address": 4409, "source": null, "section": ".text", "text": " push %rbp"},{"labels": [], "opcodes": ["48", "89", "e5"], "address": 4410, "source": null, "section": ".text", "text": " mov %rsp,%rbp"},{"labels": [{"name": "void a()", "range": {"startCol": 15, "endCol": 33}}], "opcodes": ["e8", "20", "00", "00", "00"], "address": 4413, "source": null, "section": ".text", "text": " call 1162 ()>"},{"labels": [], "opcodes": ["48", "8d", "05", "bb", "0e", "00", "00"], "address": 4418, "source": null, "section": ".text", "text": " lea 0xebb(%rip),%rax # 2004 <_IO_stdin_used+0x4>"},{"labels": [], "opcodes": ["48", "89", "c6"], "address": 4425, "source": null, "section": ".text", "text": " mov %rax,%rsi"},{"labels": [], "opcodes": ["48", "8b", "05", "8d", "2e", "00", "00"], "address": 4428, "source": null, "section": ".text", "text": " mov 0x2e8d(%rip),%rax # 3fe0 "},{"labels": [], "opcodes": ["48", "89", "c7"], "address": 4435, "source": null, "section": ".text", "text": " mov %rax,%rdi"},{"labels": [], "opcodes": ["e8", "d5", "fe", "ff", "ff"], "address": 4438, "source": null, "section": ".text", "text": " call 1030 >& std::operator<< >(std::basic_ostream >&, char const*)@plt>"},{"labels": [], "opcodes": ["b8", "00", "00", "00", "00"], "address": 4443, "source": null, "section": ".text", "text": " mov $0x0,%eax"},{"labels": [], "opcodes": ["5d"], "address": 4448, "source": null, "section": ".text", "text": " pop %rbp"},{"labels": [], "opcodes": ["c3"], "address": 4449, "source": null, "section": ".text", "text": " ret"},{"labels": [], "address": 4450, "source": null, "section": ".text", "text": "void a():"},{"labels": [], "opcodes": ["55"], "address": 4450, "source": null, "section": ".text", "text": " push %rbp"},{"labels": [], "opcodes": ["48", "89", "e5"], "address": 4451, "source": null, "section": ".text", "text": " mov %rsp,%rbp"},{"labels": [], "opcodes": ["90"], "address": 4454, "source": null, "section": ".text", "text": " nop"},{"labels": [], "opcodes": ["5d"], "address": 4455, "source": null, "section": ".text", "text": " pop %rbp"},{"labels": [], "opcodes": ["c3"], "address": 4456, "source": null, "section": ".text", "text": " ret"}],"labelDefinitions": {"main": 1, "void a()": 13}, "filteredCount": 116} diff --git a/resources/ce-bug-8809.asm b/resources/ce-bug-8809.asm new file mode 100644 index 0000000..28f1627 --- /dev/null +++ b/resources/ce-bug-8809.asm @@ -0,0 +1,134 @@ + +resources/ce-bug-8809.o: file format elf64-x86-64 + + +Disassembly of section .init: + +0000000000001000 <_init>: + 1000: f3 0f 1e fa endbr64 + 1004: 48 83 ec 08 sub $0x8,%rsp + 1008: 48 8b 05 e1 2f 00 00 mov 0x2fe1(%rip),%rax # 3ff0 <__gmon_start__> + 100f: 48 85 c0 test %rax,%rax + 1012: 74 02 je 1016 <_init+0x16> + 1014: ff d0 call *%rax + 1016: 48 83 c4 08 add $0x8,%rsp + 101a: c3 ret + +Disassembly of section .plt: + +0000000000001020 >& std::operator<< >(std::basic_ostream >&, char const*)@plt-0x10>: + 1020: ff 35 92 2f 00 00 push 0x2f92(%rip) # 3fb8 <_GLOBAL_OFFSET_TABLE_+0x8> + 1026: ff 25 94 2f 00 00 jmp *0x2f94(%rip) # 3fc0 <_GLOBAL_OFFSET_TABLE_+0x10> + 102c: 0f 1f 40 00 nopl 0x0(%rax) + +0000000000001030 >& std::operator<< >(std::basic_ostream >&, char const*)@plt>: + 1030: ff 25 92 2f 00 00 jmp *0x2f92(%rip) # 3fc8 >& std::operator<< >(std::basic_ostream >&, char const*)@GLIBCXX_3.4> + 1036: 68 00 00 00 00 push $0x0 + 103b: e9 e0 ff ff ff jmp 1020 <_init+0x20> + +Disassembly of section .plt.got: + +0000000000001040 <__cxa_finalize@plt>: + 1040: ff 25 8a 2f 00 00 jmp *0x2f8a(%rip) # 3fd0 <__cxa_finalize@GLIBC_2.2.5> + 1046: 66 90 xchg %ax,%ax + +Disassembly of section .text: + +0000000000001050 <_start>: + 1050: f3 0f 1e fa endbr64 + 1054: 31 ed xor %ebp,%ebp + 1056: 49 89 d1 mov %rdx,%r9 + 1059: 5e pop %rsi + 105a: 48 89 e2 mov %rsp,%rdx + 105d: 48 83 e4 f0 and $0xfffffffffffffff0,%rsp + 1061: 50 push %rax + 1062: 54 push %rsp + 1063: 45 31 c0 xor %r8d,%r8d + 1066: 31 c9 xor %ecx,%ecx + 1068: 48 8d 3d ca 00 00 00 lea 0xca(%rip),%rdi # 1139
+ 106f: ff 15 63 2f 00 00 call *0x2f63(%rip) # 3fd8 <__libc_start_main@GLIBC_2.34> + 1075: f4 hlt + 1076: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) + 107d: 00 00 00 + +0000000000001080 : + 1080: 48 8d 3d 89 2f 00 00 lea 0x2f89(%rip),%rdi # 4010 <__TMC_END__> + 1087: 48 8d 05 82 2f 00 00 lea 0x2f82(%rip),%rax # 4010 <__TMC_END__> + 108e: 48 39 f8 cmp %rdi,%rax + 1091: 74 15 je 10a8 + 1093: 48 8b 05 4e 2f 00 00 mov 0x2f4e(%rip),%rax # 3fe8 <_ITM_deregisterTMCloneTable> + 109a: 48 85 c0 test %rax,%rax + 109d: 74 09 je 10a8 + 109f: ff e0 jmp *%rax + 10a1: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) + 10a8: c3 ret + 10a9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) + +00000000000010b0 : + 10b0: 48 8d 3d 59 2f 00 00 lea 0x2f59(%rip),%rdi # 4010 <__TMC_END__> + 10b7: 48 8d 35 52 2f 00 00 lea 0x2f52(%rip),%rsi # 4010 <__TMC_END__> + 10be: 48 29 fe sub %rdi,%rsi + 10c1: 48 89 f0 mov %rsi,%rax + 10c4: 48 c1 ee 3f shr $0x3f,%rsi + 10c8: 48 c1 f8 03 sar $0x3,%rax + 10cc: 48 01 c6 add %rax,%rsi + 10cf: 48 d1 fe sar $1,%rsi + 10d2: 74 14 je 10e8 + 10d4: 48 8b 05 1d 2f 00 00 mov 0x2f1d(%rip),%rax # 3ff8 <_ITM_registerTMCloneTable> + 10db: 48 85 c0 test %rax,%rax + 10de: 74 08 je 10e8 + 10e0: ff e0 jmp *%rax + 10e2: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1) + 10e8: c3 ret + 10e9: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) + +00000000000010f0 <__do_global_dtors_aux>: + 10f0: f3 0f 1e fa endbr64 + 10f4: 80 3d 15 2f 00 00 00 cmpb $0x0,0x2f15(%rip) # 4010 <__TMC_END__> + 10fb: 75 2b jne 1128 <__do_global_dtors_aux+0x38> + 10fd: 55 push %rbp + 10fe: 48 83 3d ca 2e 00 00 cmpq $0x0,0x2eca(%rip) # 3fd0 <__cxa_finalize@GLIBC_2.2.5> + 1105: 00 + 1106: 48 89 e5 mov %rsp,%rbp + 1109: 74 0c je 1117 <__do_global_dtors_aux+0x27> + 110b: 48 8b 3d f6 2e 00 00 mov 0x2ef6(%rip),%rdi # 4008 <__dso_handle> + 1112: e8 29 ff ff ff call 1040 <__cxa_finalize@plt> + 1117: e8 64 ff ff ff call 1080 + 111c: c6 05 ed 2e 00 00 01 movb $0x1,0x2eed(%rip) # 4010 <__TMC_END__> + 1123: 5d pop %rbp + 1124: c3 ret + 1125: 0f 1f 00 nopl (%rax) + 1128: c3 ret + 1129: 0f 1f 80 00 00 00 00 nopl 0x0(%rax) + +0000000000001130 : + 1130: f3 0f 1e fa endbr64 + 1134: e9 77 ff ff ff jmp 10b0 + +0000000000001139
: + 1139: 55 push %rbp + 113a: 48 89 e5 mov %rsp,%rbp + 113d: e8 20 00 00 00 call 1162 ()> + 1142: 48 8d 05 bb 0e 00 00 lea 0xebb(%rip),%rax # 2004 <_IO_stdin_used+0x4> + 1149: 48 89 c6 mov %rax,%rsi + 114c: 48 8b 05 8d 2e 00 00 mov 0x2e8d(%rip),%rax # 3fe0 + 1153: 48 89 c7 mov %rax,%rdi + 1156: e8 d5 fe ff ff call 1030 >& std::operator<< >(std::basic_ostream >&, char const*)@plt> + 115b: b8 00 00 00 00 mov $0x0,%eax + 1160: 5d pop %rbp + 1161: c3 ret + +0000000000001162 ()>: + 1162: 55 push %rbp + 1163: 48 89 e5 mov %rsp,%rbp + 1166: 90 nop + 1167: 5d pop %rbp + 1168: c3 ret + +Disassembly of section .fini: + +000000000000116c <_fini>: + 116c: f3 0f 1e fa endbr64 + 1170: 48 83 ec 08 sub $0x8,%rsp + 1174: 48 83 c4 08 add $0x8,%rsp + 1178: c3 ret diff --git a/src/objdump/parser.cpp b/src/objdump/parser.cpp index 59d102b..3843738 100644 --- a/src/objdump/parser.cpp +++ b/src/objdump/parser.cpp @@ -152,22 +152,85 @@ void AsmParser::ObjDumpParser::label() void AsmParser::ObjDumpParser::labelref() { - if (!this->state.ignoreUntilNextLabel) + if (this->state.ignoreUntilNextLabel) + { + this->state.currentLabelReference = {}; + return; + } + + std::size_t lastBracketPos = this->state.text.find_last_of('>'); + if (lastBracketPos == std::string::npos) + { + this->state.currentLabelReference = {}; + return; + } + + std::size_t startBracketPos = std::string::npos; + for (std::size_t i = lastBracketPos; i-- > 0;) + { + if (this->state.text[i] == '<') + { + if (i == 0 || is_whitespace(this->state.text[i - 1])) + { + startBracketPos = i; + } + } + } + + if (startBracketPos != std::string::npos && startBracketPos < lastBracketPos) { - this->state.currentLabelReference.range.end_col = static_cast(ustrlen(this->state.text)); - try + std::size_t labelEndPos = lastBracketPos; + + std::size_t lastPlusPos = this->state.text.find_last_of('+', lastBracketPos); + + if (lastPlusPos != std::string::npos && lastPlusPos > startBracketPos) { - this->state.currentLabelReference.name = this->state.text.substr(this->state.currentLabelReference.range.start_col); + std::size_t offsetLen = lastBracketPos - lastPlusPos - 1; - if (!AssemblyTextParserUtils::shouldIgnoreFunction(this->state.currentLabelReference.name, this->filter)) + if (offsetLen >= 3 && this->state.text[lastPlusPos + 1] == '0' && this->state.text[lastPlusPos + 2] == 'x') { - this->state.currentLine.labels.push_back(this->state.currentLabelReference); + bool validHex = true; + for (std::size_t i = 3; i <= offsetLen; ++i) + { + if (!is_hex(this->state.text[lastPlusPos + i])) + { + validHex = false; + break; + } + } + + if (validHex) + { + labelEndPos = lastPlusPos; + } } } - catch (...) + + if (labelEndPos > startBracketPos + 1) { - // ignore erroneous nonsense - this->state.currentLabelReference.name = ""; + try + { + std::string_view text_view(this->state.text); + + this->state.currentLabelReference.range.start_col = + static_cast(ustrlen(text_view.substr(0, startBracketPos)) + 1); + + this->state.currentLabelReference.range.end_col = + static_cast(ustrlen(text_view.substr(0, labelEndPos))); + + std::size_t nameLen = labelEndPos - startBracketPos - 1; + this->state.currentLabelReference.name = text_view.substr(startBracketPos + 1, nameLen); + + if (!AssemblyTextParserUtils::shouldIgnoreFunction(this->state.currentLabelReference.name, this->filter)) + { + this->state.currentLine.labels.push_back(this->state.currentLabelReference); + } + } + catch (...) + { + // ignore erroneous nonsense + this->state.currentLabelReference.name = ""; + } } } @@ -316,6 +379,10 @@ void AsmParser::ObjDumpParser::fromStream(std::istream &in) } else if (c == '\n') { + if (!this->state.inComment && !this->state.inLabel) + { + this->labelref(); + } this->eol(); continue; } @@ -451,30 +518,11 @@ void AsmParser::ObjDumpParser::fromStream(std::istream &in) { if (c == '#') { - this->state.inComment = true; - } - else if (c == '<') - { - this->state.inSomethingWithALabel = true; - this->state.currentLabelReference.range = - asm_range{ .start_col = static_cast(ustrlen(this->state.text) + 1), - .end_col = static_cast(0) }; - } - else if (this->state.inSomethingWithALabel) - { - if (c == '>') + if (!this->state.inLabel) { - this->state.inSomethingWithALabel = false; - if (this->state.currentLabelReference.name.empty()) - { - this->labelref(); - } - } - else if (c == '+') - { - this->state.inSomethingWithALabel = false; this->labelref(); } + this->state.inComment = true; } } diff --git a/src/test/asmtext_filter_tests.cpp b/src/test/asmtext_filter_tests.cpp index 0228f43..5a154fd 100644 --- a/src/test/asmtext_filter_tests.cpp +++ b/src/test/asmtext_filter_tests.cpp @@ -269,3 +269,36 @@ TEST_CASE("example-llvm-objdump") ApprovalTests::Approvals::verify(ss.str()); } + +TEST_CASE("ce-bug-8809") +{ + AsmParser::Filter filter; + filter.binary = true; + filter.plt = true; + filter.library_functions = true; + filter.unused_labels = true; + + std::string asmpath; + if (std::filesystem::current_path().string().ends_with("test")) + { + asmpath = "../../../resources/ce-bug-8809.asm"; + } + else + { + asmpath = "../../resources/ce-bug-8809.asm"; + } + + AsmParser::ObjDumpParser parser(filter); + parser.setReproducible(); + + std::fstream fs; + fs.open(asmpath, std::fstream::in); + REQUIRE(fs.is_open() == true); + + parser.fromStream(fs); + + std::stringstream ss; + parser.outputJson(ss); + + ApprovalTests::Approvals::verify(ss.str()); +}