CodeQL library for Go
codeql/go-all 0.7.15-dev (changelog, source)
Search

Predicate CFG::mayReturnNormally

Holds if the function f may return without panicking, exiting the process, or looping forever.

This is defined conservatively, and so may also hold of a function that in fact cannot return normally, but never fails to hold of a function that can return normally.

Import path

import semmle.go.controlflow.ControlFlowGraphImpl
predicate mayReturnNormally(ControlFlowTree root)