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
sp_re_error_handler = fn;}static voidstatic __attribute__((noreturn)) voidcompile_error(re_compiler *c, const char *msg){ if (c->stripped) free(c->stripped);lib/sp_bigint.cmodifiedView file
Loading diff…
lib/sp_core.cmodifiedView file
Loading diff…
lib/sp_fiber.cmodifiedView file
Loading diff…
lib/sp_io.cmodifiedView file
Loading diff…
lib/sp_strscan.cmodifiedView file
Loading diff…