Skip to content

C#: Fix various extraction errors#1555

Merged
hvitved merged 9 commits intogithub:masterfrom
calumgrant:cs/typemention-fixes
Aug 30, 2019
Merged

C#: Fix various extraction errors#1555
hvitved merged 9 commits intogithub:masterfrom
calumgrant:cs/typemention-fixes

Conversation

@calumgrant
Copy link
Contributor

Fix 3 classes of extraction error:

  1. Extracting multi-dimensional arrays, e.g. byte *[][] tripped up the typemention logic.
  2. Not treating _ as a regular variable name in a foreach, resulting in an unextracted local variable.
  3. nameof(System), where System is a namespace resulted in an unknown identifier type.

The last one required DB changes, because a NameOfExpr should ideally have a getAccess(), which in turn means that Namespace should be @accessible and we needed a new type of expression, @namespace_access_expr to represent this access. This is not super important but may as well be done for completeness.

@calumgrant calumgrant added C# depends on internal PR This PR should only be merged in sync with an internal Semmle PR labels Jul 5, 2019
@calumgrant calumgrant requested a review from hvitved July 5, 2019 12:24
@calumgrant calumgrant requested a review from a team as a code owner July 5, 2019 12:24
@hvitved
Copy link
Contributor

hvitved commented Jul 31, 2019

The unit tests are failing, I will have a look once the PR is green.

@calumgrant calumgrant force-pushed the cs/typemention-fixes branch from f7861ee to d05e573 Compare August 2, 2019 09:07
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two questions, otherwise LGTM.

@calumgrant calumgrant force-pushed the cs/typemention-fixes branch from d05e573 to 7d72923 Compare August 23, 2019 15:20
@calumgrant
Copy link
Contributor Author

Dist-compare results are as follows:

Project              fc0ffedda7a@1c51c3468  fc0ffedda7a@84fa0fb6d
corefx               4011                   3750                   0.934929
OrchardCore          2062                   2026                   0.982541
mono                 17798                  17739                  0.996685
OneOf                1541                   1537                   0.997404
PowerShell           1579                   1580                   1.00063
ql                   581                    584                    1.00516
EntityFrameworkCore  3464                   3496                   1.00924
coreclr              913                    929                    1.01752
roslyn               4403                   4487                   1.01908

@calumgrant calumgrant force-pushed the cs/typemention-fixes branch from 84fa0fb to 4dd4167 Compare August 29, 2019 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# depends on internal PR This PR should only be merged in sync with an internal Semmle PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants