Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0124f5e

Browse files
Fix performance issue from join on start column.
1 parent9969544 commit0124f5e

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

‎cpp/common/src/codingstandards/cpp/AlertReporting.qll‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,25 @@ module MacroUnwrapper<ResultType ResultElement> {
1717
result.getAnAffectedElement()=re
1818
}
1919

20+
privateMacroInvocationgetASubsumedMacroInvocation(ResultElementre){
21+
result=getAMacroInvocation(re)and
22+
// Only report cases where the element is not located at the macro expansion site
23+
// This means we'll report results in macro arguments in the macro argument
24+
// location, not within the macro itself.
25+
//
26+
// Do not join start column values.
27+
pragma[only_bind_out](result.getLocation().getStartColumn())=
28+
pragma[only_bind_out](re.getLocation().getStartColumn())
29+
}
30+
2031
/**
2132
* Gets the primary macro invocation that generated the result element.
2233
*
2334
* Does not hold for cases where the result element is located at a macro argument site.
2435
*/
2536
MacroInvocationgetPrimaryMacroInvocation(ResultElementre){
2637
exists(MacroInvocationmi|
27-
mi=getAMacroInvocation(re)and
28-
// Only report cases where the element is not located at the macro expansion site
29-
// This means we'll report results in macro arguments in the macro argument
30-
// location, not within the macro itself
31-
mi.getLocation().getStartColumn()=re.getLocation().getStartColumn()and
38+
mi=getASubsumedMacroInvocation(re)and
3239
// No other more specific macro that expands to element
3340
notexists(MacroInvocationotherMi|
3441
otherMi=getAMacroInvocation(re)andotherMi.getParentInvocation()=mi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp