Commit Graph

5239 Commits

Author SHA1 Message Date
Dave Bartolomeo
08af0803ff Add examples to QLDoc comment 2020-10-20 17:34:46 -04:00
Dave Bartolomeo
8c8daa38ec Update stats 2020-10-20 13:41:52 -04:00
Dave Bartolomeo
4ba281731c Fix IR generation for member access with a prvalue on the RHS
For historical reasons, the extractor marks the temporary object expression used as the qualifier of a member access as a prvalue(load), even though the current C++ standard says that the temporary object materialization results in a glvalue. Added some special handling to ignore the load for both field accesses and member function calls.

This fixes all of the consistency failures in our regular tests, and all of the related failures in `syntax-zoo` other than the ones that deal with pointers-to-member, which aren't really supported yet anyway.
2020-10-20 12:53:47 -04:00
Geoffrey White
17ff34267a C++: Resolve the overlap. 2020-10-20 17:47:49 +01:00
Geoffrey White
7db2b2ce37 C++: Make the two queries more alike. 2020-10-20 17:46:47 +01:00
Geoffrey White
4630c69950 C++: Add a test case resembling the example from ODASA-3940. 2020-10-20 17:39:32 +01:00
Geoffrey White
857a4d8a3f C++: Merge the two tests, so that overlaps are obvious. 2020-10-20 17:33:15 +01:00
Geoffrey White
a372578571 C++: Move the SizeCheck*.ql tests to the standard location. 2020-10-20 16:02:54 +01:00
Geoffrey White
8198b96eb2 C++: Add test cases. 2020-10-20 15:33:57 +01:00
Dave Bartolomeo
735c657326 IR consistency checks for FieldAddress and this arguments that are not actually addresses.
Exposes failures in existing tests. Also added a small test case for `FieldAddress` on a prvalue.
2020-10-20 10:32:28 -04:00
Geoffrey White
540af7866c C++: Test spacing. 2020-10-20 15:23:15 +01:00
Geoffrey White
cbf55ce51a Merge branch 'main' into intmultlong 2020-10-20 14:55:53 +01:00
Dave Bartolomeo
7de6415d00 Accept test diffs after merge 2020-10-20 07:40:44 -04:00
Dave Bartolomeo
ade6d10e58 Merge remote-tracking branch 'upstream/main' into work 2020-10-20 07:24:42 -04:00
Mathias Vorreiter Pedersen
528afc55ab Merge pull request #3788 from geoffw0/callderef
C++: Add bcopy to models and use it.
2020-10-20 12:15:23 +02:00
Geoffrey White
f9987cff64 C++: Update QLDoc comment. 2020-10-20 09:36:33 +01:00
Dave Bartolomeo
2eaa4a4ecf Merge remote-tracking branch 'upstream/main' into work 2020-10-19 15:19:03 -04:00
Dave Bartolomeo
3587235b4f Merge pull request #4471 from github/igfoo/unnamed
C++: Be more consistent about unnamed entities
2020-10-19 15:18:34 -04:00
Dave Bartolomeo
d0b93df4ec Merge from main 2020-10-19 15:17:19 -04:00
Ian Lynagh
987c16ed53 Merge remote-tracking branch 'upstream/main' into igfoo/unnamed 2020-10-19 19:09:41 +01:00
Geoffrey White
a426412b4e Merge pull request #4497 from vadi2/patch-1
Add modern C++ variant
2020-10-19 19:09:23 +01:00
Geoffrey White
b68f98b332 C++: More use of [, ]. 2020-10-19 19:05:29 +01:00
Geoffrey White
658dbf45d2 C++: getParameter(_) is considered an anti-pattern. 2020-10-19 18:42:33 +01:00
Robert Marsh
5d9f54e797 Merge pull request #4502 from dbartol/dbartol/PrintLoadStoreTargets
C++: Print target variable name for `Load` and `Store`, if known
2020-10-19 13:30:39 -04:00
Geoffrey White
ddc5150080 C++: Create a module for models of things in Std. 2020-10-19 18:27:20 +01:00
Geoffrey White
3fad597bbf C++: Make function models private (except ones we anticipate users accessing). 2020-10-19 18:25:23 +01:00
Robert Marsh
aad6d43423 C++: autoformat 2020-10-19 10:12:16 -07:00
Geoffrey White
8646d5c811 C++: Fix test failure (we no longer have taint flow from the size parameter). 2020-10-19 17:37:11 +01:00
Geoffrey White
541a449bc4 Merge branch 'main' into callderef 2020-10-19 17:15:33 +01:00
Vadim Peretokin
aa578ed334 Update cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2020-10-19 16:58:17 +02:00
Geoffrey White
460fbea253 C++: Add some more cases. 2020-10-19 15:54:42 +01:00
Geoffrey White
6280b7d5d4 C++: Add the example code for IntMultToLong to the test. 2020-10-19 15:45:31 +01:00
Vadim Peretokin
f403c9d02c Update cpp/ql/src/Likely Bugs/Arithmetic/IntMultToLong.cpp
Co-authored-by: Geoffrey White <40627776+geoffw0@users.noreply.github.com>
2020-10-19 12:49:32 +02:00
Dave Bartolomeo
ece20cdb5e Merge branch 'main' into dbartol/temporaries/work 2020-10-18 13:11:06 -04:00
Dave Bartolomeo
2f34c78552 Fix formatting 2020-10-18 11:08:42 -04:00
Dave Bartolomeo
0b2acff837 Add upgrade script 2020-10-18 08:42:24 -04:00
Dave Bartolomeo
939bfae6e0 Fix formatting 2020-10-18 08:32:08 -04:00
Dave Bartolomeo
5f6ae32f1c Accept test output after merge 2020-10-17 18:16:21 -04:00
Dave Bartolomeo
129e250569 Update test expectations 2020-10-17 17:01:24 -04:00
Dave Bartolomeo
eb9cea48b8 Fix modeling of std::set::emplace 2020-10-17 17:00:29 -04:00
Dave Bartolomeo
40cd96eb1d Merge from main 2020-10-17 15:14:26 -04:00
Dave Bartolomeo
4e0afb0dc3 Print targets of Load and Store instructions in IR dump 2020-10-17 15:01:45 -04:00
Dave Bartolomeo
e4fdf699ad Accept improved test results 2020-10-17 14:33:10 -04:00
Dave Bartolomeo
4814dcf145 Print partial flow info in PrintIRLocalFlow.qll 2020-10-17 14:32:31 -04:00
Dave Bartolomeo
a80c6fbf97 C++: Print target variable name for Load and Store, if known
Now that we've started printing the targets of `Call` instructions in the IR dumps, I figured I might as well print the names of the variable being loaded or stored as well. We could potentially extend this to match fields, array elements, etc., but that's quite a bit more work.
2020-10-17 14:21:27 -04:00
Dave Bartolomeo
100f13f202 C++: Annotate IR with partial flow info
I've added one more property to the annotations provided by `PrintIRLocalFlow.qll`: The `pflow` property will now be emitted for any operand or instruction for which `configuration.hasPartialFlow` determines that there is partial flow to that node. This requires that partial flow be enabled via overriding `Configuration::explorationLimit()` in order to display. Otherwise, you'll still just get the local flow info as before.
2020-10-17 13:17:08 -04:00
Dave Bartolomeo
1dae8f62c1 Model copy-ish constructors for std::pair 2020-10-17 11:33:20 -04:00
Dave Bartolomeo
1b53c4684d Fix test expectations due to pair/make_pair fixes 2020-10-17 09:46:18 -04:00
Dave Bartolomeo
686f5aa8ed Handle parameter indirections in make_shared and make_unique 2020-10-17 08:53:55 -04:00
Dave Bartolomeo
7da4eef90d Fix subtle typing issue with std::makr_pair 2020-10-17 08:53:20 -04:00