[BUG]: Library code filter leaves the label of each consecutive library function in binary output
Describe the bug
With the "Library code" filter on, the binary view removes the label of a library function only when that function directly follows user code. When library functions follow one another, the first label is dropped but each later one stays, so the view shows a run of empty labels with no code under them.
In lib/parsers/asm-parser.ts (processBinaryAsm), the label of the previous function is popped only while mayRemovePreviousLabel is true, and the flag is then cleared. It is set again only by a line of user code, so a new function label pushed after the first pop is never removed.
Steps to reproduce
const objdump = [
'0000000000401000 <lib_a>:',
' 401000:\tc3 \tret',
'0000000000401001 <lib_b>:',
' 401001:\tc3 \tret',
'0000000000401002 <lib_c>:',
' 401002:\tc3 \tret',
'0000000000401003 <main>:',
'/tmp/compiler-explorer-compiler/example.c:3',
' 401003:\tc3 \tret',
].join('\n');
new AsmParser().processBinaryAsm(objdump, {libraryCode: true}).asm.map(l => l.text);gives ["lib_b:", "lib_c:", "main:", " ret"].
In the UI: compile anything to a binary, turn on the library code filter, and look at where two or more functions without line information are laid out back to back.
Expected behavior
["main:", " ret"]. Every library function should be hidden the same way, not only the first one after user code.
Source: compiler-explorer/compiler-explorer