Commit Graph

1716 Commits

Author SHA1 Message Date
Dave Bartolomeo
1e96404ee0 Revert bad changes to basic_string 2020-10-23 13:46:27 -04:00
Dave Bartolomeo
bace0dca6d Handle more cases that require synthesizing temporary objects
- Parens around qualifier expressions
- Inheritance conversions involving class prvalues
2020-10-23 12:04:09 -04:00
Dave Bartolomeo
b62bda6c3a Fix regression due to primary instructions for side effects not being computed correctly in the presence of synthetic temporary objects. 2020-10-22 12:55:30 -04:00
Geoffrey White
ceea947f5e C++: Add another test case. 2020-10-22 12:41:23 +01:00
Geoffrey White
3cca8443f8 C++: Add memcpy(vector test. 2020-10-22 09:46:07 +01:00
Geoffrey White
227bf91626 C++: Correct test annotation. 2020-10-22 09:45:09 +01:00
Dave Bartolomeo
f7eeadadd9 Accept more diffs 2020-10-21 18:37:49 -04:00
Dave Bartolomeo
5259f86e32 Accept diff (needs further investigation, though) 2020-10-21 18:06:34 -04:00
Robert Marsh
1a365d2098 C++: remove InitializeNonLocalInstruction from IR
Instead, have AliasedDefinition initialize read-only nonlocal memory
2020-10-21 12:12:38 -07:00
Dave Bartolomeo
ee18db7b36 Fix IR for member accesses on prvalues
This fixes the IR generation for member accesses where the qualifier is a prvalue that is _not_ the load of a `TemporaryObjectExpr`. We synthesize a temporary variable during IR generation instead. It fits into the IR construction code at the same spot as `TranslatedLoad`, since it's basically the opposite of `TranslatedLoad` (prvalue->glvalue instead of vice versa). Note that array prvalues require special treatment.

This fixes some consistency errors in the `syntax-zoo`. It introduces three new ones in `dataflow-ir-consistency.expected`, but those are along the same lines as tons of existing failures.
2020-10-21 13:32:15 -04:00
Robert Marsh
413c845e97 Merge branch 'main' into rdmarsh2/cpp/output-iterators-2
Accept test changes for unnamed elements
2020-10-20 15:22:08 -07:00
Dave Bartolomeo
98e0ae4865 Add tests for member accesses on temporary objects 2020-10-20 17:35:12 -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
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
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
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
8646d5c811 C++: Fix test failure (we no longer have taint flow from the size parameter). 2020-10-19 17:37:11 +01: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
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
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
1b53c4684d Fix test expectations due to pair/make_pair fixes 2020-10-17 09:46:18 -04:00
Dave Bartolomeo
7da4eef90d Fix subtle typing issue with std::makr_pair 2020-10-17 08:53:20 -04:00
Dave Bartolomeo
675256acab Accept test diffs from set.cpp (50 new good results!) 2020-10-16 17:14:41 -04:00
Dave Bartolomeo
af799a79da Accept good test diffs 2020-10-16 17:07:46 -04:00
Robert Marsh
1f8167b47b C++: fix test annotations
Co-authored-by: Jonas Jensen <jbj@github.com>
2020-10-16 16:16:27 -04:00
Dave Bartolomeo
6a9ecf7ba2 Dump static call target for Call instructions 2020-10-16 12:55:30 -04:00
Dave Bartolomeo
6a6eadcf50 C++: Print static call target for Call instruction in dumps 2020-10-16 11:53:27 -04:00
Dave Bartolomeo
14ac9859c1 Remove more ODR violations from test code.
PrintAST now works on `library-tests/dataflow/taint-tests`.
2020-10-16 10:26:42 -04:00
Mathias Vorreiter Pedersen
ca534ccb03 C++: Update inline expectation comments 2020-10-16 09:05:01 +02:00
Tom Hvitved
570b624eb7 C++: Update expected test output 2020-10-16 09:05:01 +02:00
Dave Bartolomeo
3767a52e9a Fix ODR violations in test code 2020-10-15 17:54:48 -04:00
Dave Bartolomeo
ceea5b3ec6 Fix test code that returns reference to local 2020-10-15 13:37:20 -04:00
Robert Marsh
fade75b0fb C++: add operator-- tests for insert iterators 2020-10-14 15:54:34 -07:00
Robert Marsh
126615a7ee C++: add prefix operator++ in inserter tests 2020-10-14 13:33:50 -07:00
Robert Marsh
a1a441d759 C++: output iterator flow through operator= models 2020-10-14 13:06:11 -07:00
Robert Marsh
f3843b8a40 Revert "C++: output iterator flow with user-defined operators"
This reverts commit 28fa26629c.
2020-10-14 13:01:37 -07:00
Ian Lynagh
9e518d2555 C++: Accept test change for p#n -> (unnamed parameter n) 2020-10-14 12:59:47 +01:00
Robert Marsh
28fa26629c C++: output iterator flow with user-defined operators 2020-10-13 16:30:47 -07:00
Robert Marsh
4b6ecfb0b1 C++: remove some constexprs in qltest 2020-10-13 16:19:15 -07:00
Robert Marsh
45a27d3296 C++: add tests for back_inserter iterator flow 2020-10-13 16:19:15 -07:00
Robert Marsh
108cc9ea47 C++: fix assignment to *iter++ 2020-10-13 16:19:15 -07:00
Robert Marsh
f39195e339 C++: add tests for assignments to *iter++ 2020-10-13 16:19:15 -07:00
Ian Lynagh
7680080701 C++: Accept unnamed-function changes to tests 2020-10-13 23:52:33 +01:00
Robert Marsh
b49aa677d0 Merge pull request #4459 from geoffw0/setex
C++: Additional taint flows through std::set
2020-10-13 15:17:54 -04:00