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

Commit472c93a

Browse files
Add changes to join order and prevent cartesian product through rewrite
1 parented088be commit472c93a

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

‎cpp/common/src/codingstandards/cpp/types/Compatible.qll‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ module TypesCompatibleConfig implements TypeEquivalenceSig {
5353
or
5454
// Enum types are compatible with one of char, int, or signed int, but the implementation
5555
// decides.
56-
[t1,t2]instanceofEnumand
57-
([t1,t2]instanceofCharTypeor[t1,t2]instanceofIntType)
56+
t1instanceofEnumand
57+
(t2instanceofCharTypeort2instanceofIntType)
58+
or
59+
t2instanceofEnumand
60+
(t1instanceofCharTypeort1instanceofIntType)
5861
}
5962

6063
bindingset[t1, t2]
@@ -348,8 +351,15 @@ module FunctionDeclarationTypeEquivalence<TypeEquivalenceSig Config> {
348351
predicateequalParameterTypes(FunctionDeclarationEntryf1,FunctionDeclarationEntryf2){
349352
f1.getDeclaration()=f2.getDeclaration()and
350353
forall(inti|exists([f1,f2].getParameterDeclarationEntry(i))|
351-
TypeEquivalence<Config,FunctionSignatureType>::equalTypes(f1.getParameterDeclarationEntry(i)
352-
.getType(),f2.getParameterDeclarationEntry(i).getType())
354+
equalParameterTypesAt(f1,f2,pragma[only_bind_into](i))
355+
)
356+
}
357+
358+
predicateequalParameterTypesAt(FunctionDeclarationEntryf1,FunctionDeclarationEntryf2,inti){
359+
pragma[only_bind_out](f1.getDeclaration())=pragma[only_bind_out](f2.getDeclaration())and
360+
TypeEquivalence<Config,FunctionSignatureType>::equalTypes(
361+
f1.getParameterDeclarationEntry(i).getType(),
362+
f2.getParameterDeclarationEntry(i).getType()
353363
)
354364
}
355365
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp