Commit Graph

7071 Commits

Author SHA1 Message Date
Dave Bartolomeo
4a1d04b423 C++: Fix deprecated predicate warnings 2018-09-04 10:30:48 -07:00
Geoffrey White
ae80b8dbec Merge pull request #145 from nickrolfe/rewording
C++: clearer alert wording in integer-multiplication-cast-to-long
2018-09-04 18:00:37 +01:00
Geoffrey White
71483c7025 CPP: Remove some empty source files. 2018-09-04 17:51:46 +01:00
Dave Bartolomeo
fce7a5fccb C++: Final IR reshuffle
Moved IR flavors into "implementation", with internal files under "implementation/internal". Made `IRBlockConstruction` just a nested module of `IRConstruction`/`SSAConstruction`, so it gets picked up from the `Construction` parameter of the `IR` module, rather than being picked up just from being in the same directory as `IRBlock`.
2018-09-04 09:05:27 -07:00
Dave Bartolomeo
aa4436fa22 C++: More IR reshuffling
Remove redundant "_ir" suffix.
Move non-user-importable modules into "implementation" directory.
2018-09-04 09:05:21 -07:00
Dave Bartolomeo
97cfbd9488 C++: "IR" means "Aliased SSA IR"
This change makes the public IR.qll module resolve to the flavor of the IR that we want queries to use. Today, this is the aliased SSA flavor of the IR. Should we add additional IR iterations in the future, we'll update IR.qll to resolve to whichever one we consider the default.

I moved the PrintIR.ql and IRSanity.ql queries into the internal directories of the corresponding flavors. There's still a PrintIR.ql and an IRSanity.ql in the public IR directory, which use the same IR flavor as the public IR.qll.
2018-09-04 09:05:15 -07:00
Dave Bartolomeo
9fd5f26e2e C++: Remove unnecessary Impl suffix from some files 2018-09-04 09:05:10 -07:00
Dave Bartolomeo
aacee8fecf C++: Reshuffle IR files into a consistent directory structure
There are no real code changes here, other than to fix up `import`s. All tests still hae the same output, as expected.

A future commit will hide the IR flavors other than the one we want queries to use directly.
2018-09-04 09:05:03 -07:00
Aditya Sharad
ab2bec743a Revert "Version: Bump to 1.19.0 dev."
The version bump should now go into the `next` branch rather than `master`.
This reverts commit 2363f49e3a.
2018-09-04 16:01:09 +01:00
Nick Rolfe
f2d030a7e6 C++: shorten message in integer-multiplication-cast-to-long 2018-09-04 14:45:12 +01:00
Jonas Jensen
e0ba2b2251 C++: Fix name of suppressUnusedType 2018-09-04 13:38:28 +02:00
Jonas Jensen
ab944f3807 Merge pull request #139 from geoffw0/function-wrappers
CPP: Make FunctionWithWrappers `toCause` work on builtins.
2018-09-04 13:36:33 +02:00
Ian Lynagh
3fd6a8de7d C++: Fix the definition of GlobalNamespace.getADeclaration()
Globals can still have declarations in declaration statements.
We already rule out local variables etc via the isTopLevel check,
so we don't need to consider DeclStmt.
2018-09-04 11:37:10 +01:00
Jonas Jensen
73675e29f2 Merge pull request #138 from ian-semmle/topLevel
C++: Use Declaration.isTopLevel() in GlobalNamespace.getADeclaration()
2018-09-04 10:03:19 +02:00
Jonas Jensen
07bacbf389 C++: Follow suppressUnusedThis convention 2018-09-04 09:40:50 +02:00
Jonas Jensen
6e9cc46e80 Merge pull request #131 from ian-semmle/namespace_vars
C++: Give namespace variables a qualified name
2018-09-04 08:56:01 +02:00
Jonas Jensen
a2946f71bd Merge pull request #96 from ian-semmle/typo
C++: Fix typo
2018-09-04 08:51:15 +02:00
Jonas Jensen
adc5ee86ad Merge pull request #128 from geoffw0/cwe-190-precision
CPP: Adjust precisions for the CWE-190 queries.
2018-09-04 08:44:38 +02:00
Ian Lynagh
4230adbca2 C++: Remove reundant override 2018-09-03 18:12:30 +01:00
Nick Rolfe
04e919df9d C++: clearer alert wording in integer-multiplication-cast-to-long 2018-09-03 16:56:56 +01:00
Aditya Sharad
2363f49e3a Version: Bump to 1.19.0 dev.
This keeps the QL for Eclipse language plugins in sync with internal `master`.
2018-09-03 16:41:28 +01:00
Jonas Jensen
88f80e4d4b C++: Silence two more QL compiler warnings
One was for an unused parameter (a deliberate CP of `Type` x
`VoidType`), and one was for use of a deprecated predicate.
2018-09-03 13:45:04 +02:00
Jonas Jensen
ab6dc1d70c C++: Add missing override annotations 2018-09-03 13:22:22 +02:00
Geoffrey White
d5b7ab5aa1 CPP: Make FunctionWithWrappers toCause work on builtin functions. 2018-09-03 11:26:02 +01:00
Geoffrey White
3e18a9b885 CPP: Improve the special case for realloc in MemoryMayNotBeFreed.ql. 2018-09-03 08:30:05 +01:00
Ian Lynagh
c8fcab8cfe C++: Use Declaration.isTopLevel() in GlobalNamespace.getADeclaration() 2018-09-03 01:01:10 +01:00
Ian Lynagh
f6582ef285 C++: Fix typo 2018-09-01 15:45:41 +01:00
Jonas Jensen
98612b9f9a C++: Tidy primitive_basic_block_member calculation
This change gave a slight speed-up by eliminating an unnecessary
intermediate predicate.
2018-09-01 07:46:00 +02:00
Ian Lynagh
3a00e24e89 C++: Give NamespaceVariables a qualified name 2018-08-31 16:39:21 +01:00
Geoffrey White
074894298c CPP: Adjust precisions for the CWE-190 queries. 2018-08-31 16:15:53 +01:00
Nick Rolfe
0589be1b8a C++: add qldoc comments for aggregate_{field,array}_init 2018-08-30 22:42:31 +01:00
Nick Rolfe
2130622028 C++: use underlyingElement & unresolveElement for get{Element,Field}Expr 2018-08-30 22:42:31 +01:00
Nick Rolfe
7556f22ff1 C++: stats for aggregate_{field,array}_init 2018-08-30 22:42:30 +01:00
Nick Rolfe
23c648904f C++: properly formatted comments for builtin type kinds 2018-08-30 22:42:30 +01:00
Nick Rolfe
d068d71ccb C++: dbscheme/library changes to support C99 designated initializers 2018-08-30 22:42:30 +01:00
Jonas Jensen
e7234f5cf3 C++: Split index calculation from BB membership
Instead of computing these two things in one predicate, they are
computed in separate predicates and then joined. This splits the
predicate `primitive_basic_block_member`, which took 77s before, into
predicates that together take 18s on a medium-sized db.
2018-08-30 15:04:01 +02:00
Kevin Backhouse
6c5009225c Merge pull request #111 from olehermanse/gmtime
Fixed error in gmtime example
2018-08-29 15:55:52 -04:00
semmle-qlci
d957c151a6 Merge pull request #110 from jbj/fewer-dbtypes
Approved by ian-semmle
2018-08-29 17:26:06 +01:00
Jonas Jensen
4cc27459ca C++: Remove redundant charpred on Element 2018-08-29 14:09:04 +02:00
Jonas Jensen
8b9e4e347c C++: Introduce ElementBase class
By extending this class, a class can define its own `getLocation`
predicate without participating in the dispatch hierarchy of
`getLocation` as defined on `Element`. Classes wanting to override their
location previously had to define `getURL` or `hasLocationInfo` instead
and rely on these predicates not being defined on future versions of
`Element`.
2018-08-29 13:21:10 +02:00
Jonas Jensen
418a16772b Merge pull request #105 from geoffw0/samate-crement
CPP: Support crement operations in CWE-190
2018-08-29 09:03:29 +02:00
Ole Herman Schumacher Elgesem
00c552fe2f Fixed error in gmtime example
gmtime and gmtime_r take a time_t pointer, so have to store the value
of time(NULL) on the stack.

Signed-off-by: Ole Herman Schumacher Elgesem <oleherman93@gmail.com>
2018-08-28 11:10:11 -07:00
Geoffrey White
0d6373924c CPP: De-conflate cause and effect strings. 2018-08-28 16:39:10 +01:00
Geoffrey White
229d0406bb CPP: Add support for += and -=. 2018-08-28 16:39:10 +01:00
Geoffrey White
87fb447c4b CPP: Improve the logic in ArithmeticWithExtremeValues.ql. 2018-08-28 16:39:10 +01:00
Geoffrey White
a125e3ed86 CPP: Fix crement operations on pointers. 2018-08-28 16:39:09 +01:00
Geoffrey White
d2fd986f40 CPP: Support crement operations in CWE-190. 2018-08-28 16:39:09 +01:00
Jonas Jensen
24567c57db Merge pull request #109 from dave-bartolomeo/dave/Call
C++: `Invoke` -> `Call`
2018-08-28 15:28:22 +02:00
Jonas Jensen
f88dc37218 Merge pull request #99 from aschackmull/java/fieldflow-perf
Java/C: Improve performance when multiple configs use field flow.
2018-08-28 15:27:29 +02:00
Jonas Jensen
4536d75b2f Merge pull request #93 from ian-semmle/underlyingElement
C++: Add a missing underlyingElement call
2018-08-28 15:24:16 +02:00