Commit Graph

37 Commits

Author SHA1 Message Date
Tamas Vajk
17109a36ce Fix extraction error due to missing DLL 2021-03-02 09:21:24 +01:00
Tamás Vajk
8e7a823b9a Merge pull request #5083 from raulgarciamsft/master
Adding queries related to the Solorigate campaign
2021-02-18 13:50:45 +01:00
Raul Garcia (MSFT)
f114ef1f06 Adding unit tests 2021-02-08 16:57:49 -08:00
Mathias Vorreiter Pedersen
4c3a26fea8 Revert "Merge pull request #4558 from rdmarsh2/rdmarsh2/cpp/remove-initialize-nonlocal"
This reverts commit 08efd7fbd9, reversing
changes made to cb8c5e8cca.
2020-11-25 15:51:52 +01:00
Dave Bartolomeo
08efd7fbd9 Merge pull request #4558 from rdmarsh2/rdmarsh2/cpp/remove-initialize-nonlocal
Remove InitializeNonlocalInstruction
2020-11-18 20:23:08 -05:00
Tamas Vajk
8cbe8bc6b5 C#: Fix parent of 'TypeMention' for some variable declaration 2020-11-12 13:43:13 +01:00
Robert Marsh
14f1fa50f1 Merge branch 'main' into rdmarsh2/cpp/remove-initialize-nonlocal
Accept test changes from IR temporaries and block ordering
2020-11-10 11:14:26 -08:00
Robert Marsh
c00587d2cb C++/C#: Conflated memory as IR dump annotation
Removes the IR consistency checks for conflated memory and marks
instructions that have a conflated result with a percent sign (%)
instead. This avoids reimplementing part of the alias analysis logic
in the consistency check.
2020-11-09 14:55:47 -08:00
Cornelius Riemenschneider
a13947424a C++, C# IR: Stabilize sort order for basic blocks. 2020-11-04 16:26:56 +01:00
Dave Bartolomeo
7a2c59c194 Merge from main 2020-10-28 15:35:46 -04:00
Tamás Vajk
59d9be48a7 Merge pull request #4438 from tamasvajk/feature/ast-fixes
C#: Fixes for AST printing
2020-10-28 14:52:24 +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
Tamas Vajk
dad5166bca C#: Print full name of type mentions in AST 2020-10-20 08:23:57 +02:00
Tamas Vajk
ca6ecb3f1e C#: Extract type mention for array creation 2020-10-20 08:23:56 +02:00
Tamas Vajk
7066568813 C#: Change type access and expression order in casts for AST printing 2020-10-20 08:23:56 +02:00
Tamas Vajk
6c48eb8c12 C#: Add type mentions to AST 2020-10-20 08:23:56 +02:00
Dave Bartolomeo
b73cb3a4ce Accept C# IR diffs 2020-10-18 11:11:05 -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
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
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
Tamas Vajk
5fae440a58 C#: Reverse assignment child nodes in AST 2020-10-14 12:49:08 +02:00
Tamas Vajk
ee9a40e16d C#: Remove location from base types in the AST 2020-10-14 12:49:08 +02:00
Tamas Vajk
48bf6d55aa C#: Add implicit cast from array to pointer 2020-09-23 17:21:38 +02:00
Tamas Vajk
e2c205deb4 C#: Add stable order for generated accessors in printed AST 2020-09-04 10:39:01 +02:00
Tom Hvitved
b8cde180b9 C#: Order top-level elements by location in PrintAst.qll 2020-08-21 06:17:37 +02:00
Tamás Vajk
2a8ff8785a C#: Add AST printing (#4038) 2020-08-20 14:24:43 +02:00
Raul Garcia (MSFT)
64f4613a3f Removing the options file as requested 2020-07-30 10:25:15 -07:00
Raul Garcia (MSFT)
9e74c183fe Fixing expected results after adding comments to the unit test .cs file 2020-07-30 10:24:24 -07:00
Raul Garcia (MSFT)
7923c480af Fixing queries based on suggestions/comments.
TODO: Auto-formatting is still pending (need guidance on how to enable it on my environment). Thanks
2020-07-29 17:14:37 -07:00
Raul Garcia (MSFT)
5387294168 Moving to experimental as requested 2020-07-16 09:32:17 -07:00
Dave Bartolomeo
881b3c8e33 C#: Fix IR consistency errors
We were creating a `TranslatedFunction` even for functions that were not from source code, but then telling the IR package that those functions didn't have IR. This resulted in having prologue/epilogue instructions (e.g. `EnterFunction`, `ExitFunction`) with no enclosing `IRFunction`.
2020-06-15 11:33:00 -04:00
Dave Bartolomeo
8cbc7e8654 C++/C#: Improve consistency failure result messages
Some of our IR consistency failure query predicates already produced results in the schema as an `@kind problem` query, including `$@` replacements for the enclosing `IRFunction` to make it easier to figure out which function to dump when debugging. This change moves the rest of the query predicates in `IRConsistency.qll` to do the same. In addition, it wraps each call to `getEnclosingIRFunction()` to return an `OptionalIRFunction`, which can be either a real `IRFunction` or a placeholder in case `getEnclosingIRFunction()` returned no results. This exposes a couple new consistency failures in `syntax-zoo`, which will be fixed in a subsequent commit.

This change also deals with consistency failures when the enclosing `IRFunction` has more than one `Function` or `Location`. For multiple `Function`s, we concatenate the function names. For multiple `Location`s, we pick the first one in lexicographical order. This changes the number of results produced in the existing tests, but does't change the actual number of problems.
2020-06-15 10:46:46 -04:00
Tom Hvitved
70c3ff36f8 C#: Adjust IR imports 2020-06-10 09:54:56 +02:00
Tom Hvitved
3c8735f43f C#: Move IR code into 'experimental' folder 2020-06-10 09:37:30 +02:00
yo-h
43bcd5b26c Add guidelines for experimental CodeQL queries and libraries 2020-02-24 15:08:31 -05:00