Skip to content

Commit

Permalink
md_opener_stack: Mark the default branch of switch as unreachable.
Browse files Browse the repository at this point in the history
We were returning NULL previously, but that would lead to a crash
anyway; all callsites expect to get their respective stack anyway
and anything else would mean we are internally broken.
  • Loading branch information
mity committed Jan 21, 2024
1 parent 0672f27 commit 83e093f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/md4c.c
Original file line number Diff line number Diff line change
Expand Up @@ -2555,7 +2555,7 @@ md_opener_stack(MD_CTX* ctx, int mark_index)
case _T('!'):
case _T('['): return &BRACKET_OPENERS;

default: return NULL;
default: MD_UNREACHABLE();
}
}

Expand Down

0 comments on commit 83e093f

Please sign in to comment.