MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / cAlwaysExits

Function cAlwaysExits

src/graph/branch-guards.ts:1964–1974  ·  view source on GitHub ↗
(node: SyntaxNode | null)

Source from the content-addressed store, hash-verified

1962const C_EXITS = new Set(['return_statement', 'break_statement', 'continue_statement', 'goto_statement', 'throw_statement']);
1963
1964function cAlwaysExits(node: SyntaxNode | null): boolean {
1965 if (!node) return false;
1966 if (C_EXITS.has(node.type)) return true;
1967 if (node.type === 'compound_statement') return cAlwaysExits(lastNamed(node));
1968 if (node.type === 'expression_statement') {
1969 const call = node.namedChild(0);
1970 const fn = call?.type === 'call_expression' ? call.childForFieldName('function')?.text : '';
1971 return fn === 'exit' || fn === '_exit' || fn === 'abort' || fn === 'longjmp';
1972 }
1973 return false;
1974}
1975
1976const C: Rules = {
1977 boundaries: new Set([

Callers

nothing calls this directly

Calls 2

lastNamedFunction · 0.85
hasMethod · 0.80

Tested by

no test coverage detected