You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[MISRA-CERT-09] Unbounded recursion not detected or rejected (MISRA Rule 17.2) #271
The type checker has a call graph (built for @rt_safe in src/flow/type_checker.py line 1014) but does not detect direct or indirect recursion. Stack overflow from unbounded recursion is a safety hazard.
MISRA C bans direct and indirect recursion in safety-critical code.
The existing _compute_rt_unsafe_functions call graph could be extended to detect cycles.
Standards
MISRA C:2024 Rule 17.2 (Required): Functions shall not call themselves, either directly or indirectly.
CERT C MEM05-C: Avoid large stack allocations in functions that are called recursively.
Fix
Add a --no-recursion flag (or --profile safety) that makes the type checker reject any call graph cycle as an error.
Reuse _compute_rt_unsafe_functions infrastructure: after building the call graph, run a cycle detection (DFS) and report all recursive functions.
Document that recursion is allowed in default profile but banned in flight/safety profiles.
Audit ID: MISRA-CERT-09
Severity: High | Category: Type checker - control flow safety
Fixed in PR #404: Under --profile safety/flight, the type checker builds a direct call graph and runs DFS to detect cycles. Direct and mutual recursion are rejected at type-check time.
Activity
feat(safety): @max_iterations for while under safety/flight (#272)
feat(safety): @max_iterations for while under safety/flight (#272)
Merge pull request #393 from flooooooooooow/cursor/misra-euler-batch-…
godofecht commentedon Aug 10, 2026
Fixed in PR #404: Under --profile safety/flight, the type checker builds a direct call graph and runs DFS to detect cycles. Direct and mutual recursion are rejected at type-check time.
feat(safety): enforce MISRA 17.2/17.4 at type-check time, route print…