1313import cpp
1414
1515/* This is slightly subtle: The extractor adds a dummy 'return;' statement for control paths
16- that fall off the end of a function. So we can simply look for non-void functions containing
17- a non-value carrying return. If the predecessor is a return statement it means that
18- the return did not return a value. (If that return was not added by the extractor but by the
19- programmer, we can flag it anyway, since this is arguably a bug.) */
16+ * that fall off the end of a function. So we can simply look for non-void functions containing
17+ * a non-value carrying return. If the predecessor is a return statement it means that
18+ * the return did not return a value. (If that return was not added by the extractor but by the
19+ * programmer, we can flag it anyway, since this is arguably a bug.) */
2020
2121predicate functionsMissingReturnStmt ( Function f , ControlFlowNode blame ) {
2222 f .fromSource ( ) and
@@ -31,10 +31,10 @@ predicate functionsMissingReturnStmt(Function f, ControlFlowNode blame) {
3131 )
3232}
3333
34- /* If a function has a value-carrying return statement, but the extractor hit a snag
35- whilst parsing the value, then the control flow graph will not include the value.
36- As such, to avoid embarrassing false positives, we exclude any function which
37- wasn't perfectly extracted. */
34+ /** If a function has a value-carrying return statement, but the extractor hit a snag
35+ * whilst parsing the value, then the control flow graph will not include the value.
36+ * As such, to avoid embarrassing false positives, we exclude any function which
37+ * wasn't perfectly extracted. */
3838predicate functionImperfectlyExtracted ( Function f ) {
3939 exists ( CompilerError e | f .getBlock ( ) .getLocation ( ) .subsumes ( e .getLocation ( ) ) )
4040 or
0 commit comments