Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

tinycc/tinycc
mob @ a338258
25
Fixes
5
CVEs
HIGH
Peak severity
Highlights
Memory Corruption: 8 prior fixes. Scrutinize any change in this area.
tccgen.c: most-fixed (11 issues). Treat as high-risk during review.
8 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Memory Corruption: Nested scope compilation of Variable Length Arrays (VLAs) is prone to stack pointer restoration corruption when paths are bypassed at runtime, resulting in severe compile-time or runtime memory instability. Ensure the parser correctly tracks and restores the stack pointer state via scope boundaries.
Use After Free: Compiling GNU C statement expressions returning local label addresses can trigger use-after-free conditions. Label symbol reclamation must be deferred when nested within statement expressions to prevent premature freeing.
Buffer Overflow: The preprocessor is highly susceptible to buffer overflows when handling macro expansions or string concatenation via static STRING_MAX_SIZE buffers or unsafe string functions. Dynamic, bounds-aware CString allocations must be favored over fixed-size buffers.