Commit 83e093fbfc1dee4c55bd81a6649add5bcf53b0b4

Martin Mitas 2024-01-21T11:50:18

md_opener_stack: Mark the default branch of switch as unreachable. 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.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/md4c.c b/src/md4c.c
index 0907286..3093e2a 100644
--- a/src/md4c.c
+++ b/src/md4c.c
@@ -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();
     }
 }