From 4fc3bfdfc5cd7ac1d076dce51c7c037f1d587af0 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Fri, 19 Jul 2024 10:39:11 -0700 Subject: [PATCH] Make fallthrough explicit in tok_parse.c In response to #325 --- src/mwparserfromhell/parser/ctokenizer/tok_parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/mwparserfromhell/parser/ctokenizer/tok_parse.c b/src/mwparserfromhell/parser/ctokenizer/tok_parse.c index 60000d3..5cb470d 100644 --- a/src/mwparserfromhell/parser/ctokenizer/tok_parse.c +++ b/src/mwparserfromhell/parser/ctokenizer/tok_parse.c @@ -1558,6 +1558,9 @@ Tokenizer_handle_tag_close_close(Tokenizer *self) Py_XDECREF(so); Py_XDECREF(sc); } + // One of `so` or `sc` failed to allocate so we fall through to clean up the + // closing tag and propagate the error by returning NULL. + __attribute__((fallthrough)); case -1: Py_DECREF(closing); return NULL;