|
10 | 10 | import cpp |
11 | 11 |
|
12 | 12 | from |
13 | | - Variable var, ArrayExpr useExpr, VariableDeclarationEntry def, ArrayType defLine, VariableAccess use |
| 13 | + Variable var, ArrayExpr useExpr, VariableDeclarationEntry def, ArrayType defLine, |
| 14 | + VariableAccess use |
14 | 15 | where |
15 | | - def = defLine.getATypeNameUse() and |
16 | | - var = def.getDeclaration() and |
| 16 | + var.getUnspecifiedType() = defLine and |
17 | 17 | use = useExpr.getArrayBase() and |
18 | | - var = use.getTarget() and ( |
19 | | - (useExpr.getArrayOffset().getType() instanceof UInt16_t and |
20 | | - defLine.getArraySize() <= 256) or |
21 | | - (useExpr.getArrayOffset().getType() instanceof UInt32_t and |
22 | | - defLine.getArraySize() <= 900) or |
23 | | - (useExpr.getArrayOffset().getType() instanceof UInt64_t and |
24 | | - defLine.getArraySize() <= 1000) |
25 | | - ) |
26 | | -select useExpr, "Using a " + useExpr.getArrayOffset().getType() +" to acess the array $@ of size " + defLine.getArraySize() + ".", var, |
27 | | - var.getName() |
| 18 | + var = use.getTarget() and |
| 19 | + ( |
| 20 | + useExpr.getArrayOffset().getType() instanceof UInt16_t or |
| 21 | + useExpr.getArrayOffset().getType() instanceof UInt32_t or |
| 22 | + useExpr.getArrayOffset().getType() instanceof UInt64_t |
| 23 | + ) and |
| 24 | + defLine.getArraySize() <= 256 |
| 25 | +select useExpr, |
| 26 | + "Using a " + useExpr.getArrayOffset().getType() + " to acess the array $@ of size " + |
| 27 | + defLine.getArraySize() + ".", var, var.getName() |
0 commit comments