LOGBOOK

HELP

Quiz Entry - updated: 2026.07.06

How do you recognize fall-through in a switch statement's assembly?

A case block with no jmp at its end falls through into the next case's code (the C source omitted break).

A case block ending without a jmp falls straight into the next case's code (omitted break in C); a case ending with jmp to the exit label corresponds to a break.

* No jmp at a case's end = fall-through into the next case. *

# case 2: (has fall-through)
.L5:
    movq %rsi, %rax
    cqto
    idivq %rcx
    # No jmp here! Falls through to .Lmerge

# Shared code (case 2 falls into case 3's merge point)
.Lmerge:
    addq %rcx, %rax

vs a normal case (no fall-through):

# case 1: (breaks)
.L3:
    movq %rdi, %rax
    jmp  .L_exit

How to spot it:

  • Case with jmp at the end → has break in C
  • Case without jmp at the end → falls through to next case
  • Multiple labels at the same address → case 5: case 6: (combined cases)

In GDB: Step through a case block. If execution continues to the next case label without a jump, it's fall-through.

Go deeper:

From Quiz: REVE1 / Assembly Patterns & GDB | Updated: Jul 06, 2026