Commit 09859c31

09859c318480Merged

Ryan Seys <[email protected]> · 5 months ago · 6 files · ~6 modified

Description

runtime,regexp: annotate noreturn on sp_raise_cls / compile_error decls

sp_raise_cls is SP_NORETURN in sp_runtime.h, but the standalone runtime units (sp_core, sp_bigint, sp_fiber, sp_io, sp_strscan) forward-declare it without the attribute, and re_compile's compile_error -- which always exits -- lacked it too. The missing contract made the static analyzer assume execution continues past a raise, manufacturing false null-dereference and divide-by-zero reports (7 cleared here). Match the canonical contract: SP_NORETURN where sp_types.h is in scope, attribute((noreturn)) otherwise.

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

Details

Commit
09859c318480
Parent
ef0dd7102c46

lib/regexp/re_compile.cmodifiedView file

@@ -44,7 +44,7 @@
4444 sp_re_error_handler = fn;
4545 }
4646
47-static void
47+static __attribute__((noreturn)) void
4848 compile_error(re_compiler *c, const char *msg)
4949 {
5050 if (c->stripped) free(c->stripped);