Skip to content

PS: Two bugfixes reported by Chanel#330

Open
MathiasVP wants to merge 5 commits intomainfrom
chanel-fixes
Open

PS: Two bugfixes reported by Chanel#330
MathiasVP wants to merge 5 commits intomainfrom
chanel-fixes

Conversation

@MathiasVP
Copy link
Collaborator

@chanel-y identified two PowerShell issues:

  1. The first issue was that this code:

    API::getTopLevelMember(["system", "microsoft"])
      .getMember("data")
      .getMember("sqlclient")
      .getMember("sqlconnectionstringbuilder")
      .getMember("new")
      .asCall()

    did not select the new call in [Microsoft.Data.SqlClient.SqlConnectionStringBuilder]::new(...).

    Turns out this was because we didnt have type information regarding Microsoft.Data.SqlClient.SqlConnectionStringBuilder as this data is not in the XML files we have extracted from https://github.com/dotnet/dotnet-api-docs. Instead, this data is generated directly from the C# code stored at https://github.com/dotnet/SqlClient.

    So to get those types I wrote a query and a script to generate type models from C# databases. I also amended the README.md file to describe this process so that we can extend it if we encounter other cases like this (which I'm sure we will).

    With these models things Just Work 🎉

  2. The next issue was that this code:

    from DataFlow::ObjectCreationNode oc
    select oc.getAnArgument()

    did not find the $hostingConnectionString in New-Object Microsoft.Data.SqlClient.SqlConnectionStringBuilder -ArgumentList $hostingConnectionString.

    The problem was that we forgot to call super.relevantChild when we were extending certain ChildMappings in the CFG classes. This meant that CFG nodes for New-Objects had no arguments! This has been fixed in 2eb8b1a, and the result can be seen in 2b4ac31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments