Skip to content

Commit 470cb4b

Browse files
committed
limiting always inlne tainted option to 3x max stack depth
1 parent 1e3f3ae commit 470cb4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,13 +1143,14 @@ bool ExprEngine::shouldInlineCall(const CallEvent &Call, const Decl *D,
11431143
bool IsRecursive = false;
11441144
unsigned StackDepth = 0;
11451145
examineStackFrames(D, Pred->getLocationContext(), IsRecursive, StackDepth);
1146-
if (!(Opts.AnalyzerAlwaysInlineTainted && TaintRelatedFun) && (StackDepth >= Opts.InlineMaxStackDepth) &&
1146+
if (!(Opts.AnalyzerAlwaysInlineTainted && TaintRelatedFun && (StackDepth < 3*Opts.InlineMaxStackDepth))
1147+
&& (StackDepth >= Opts.InlineMaxStackDepth) &&
11471148
(!isSmall(CalleeADC) || IsRecursive))
11481149
return false;
11491150

11501151
// Do not inline large functions too many times.
11511152
// We skip this bound if the function is taint related
1152-
if (!(Opts.AnalyzerAlwaysInlineTainted && TaintRelatedFun) && (Engine.FunctionSummaries->getNumTimesInlined(D) >
1153+
if ((Engine.FunctionSummaries->getNumTimesInlined(D) >
11531154
Opts.MaxTimesInlineLarge) &&
11541155
isLarge(CalleeADC)) {
11551156
NumReachedInlineCountMax++;

0 commit comments

Comments
 (0)