File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,6 +124,11 @@ class ACAutomaton {
124124 int best_len = 0 ;
125125 for (const char *p = text; *p; p++) {
126126 int idx = static_cast <unsigned char >(*p);
127+ // Follow failure links until we find a node with a
128+ // child for this character, or reach the root.
129+ // `next` is a fixed-size array (Node*[256]), so
130+ // `!next[idx]` is a valid null-element check, not a
131+ // null-pointer dereference (clang-tidy false positive).
127132 while (cur != &root_ && !cur->next [idx])
128133 cur = cur->fail ;
129134 if (cur->next [idx])
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ namespace graph
1111// state_builder) treat them as reachable roots instead of orphans.
1212// Go's `init` is an implicit entry point executed at package load.
1313// [module=graph, method=isEntryPointName]
14- static bool isEntryPointName (const std::string &name, const std::string &language)
14+ static bool isEntryPointName (const std::string &name,
15+ const std::string &language)
1516{
1617 if (name == " main" ) {
1718 return language == " c" || language == " cpp" ||
You can’t perform that action at this time.
0 commit comments