Skip to content

Conversation

@dilanbhalla
Copy link
Collaborator

This PR syncs the latest changes from codeql-cli/latest into main.

asgerf and others added 30 commits January 7, 2026 11:05
This was initially lost after rebasing with indentation changes
Some abstract classes defines fields without binding them, leaving it up to the subclasses to bind them. When combined with overlay[local?], the charpred for such an abstract class can become local, while the subclasses are global. The means the charpred needs to be materialized, even though it doesn't bind the fields, leading to a cartesian product.
This was somehow lost in a rebase
We want the type itself to be local but nearly all its member predicates
are global.
Previously this was implied by MkClassInstance but that's no longer
the case.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
MathiasVP and others added 24 commits January 15, 2026 18:31
Rust: Avoid unnecessary constraint satisfaction
Before
```
Evaluated relational algebra for predicate TypeMention::RefTypeReprMention.resolveRootType/0#dispred#091b949a#fb@4bd8a49g with tuple counts:
            124419   ~0%    {1} r1 = RefTypeRepr::Generated::RefTypeRepr#422893fa AND NOT `RefTypeRepr::Generated::RefTypeRepr.isMut/0#dispred#e2b9988f`(FIRST 1)
        6621454761   ~1%    {3}    | JOIN WITH `Type::DataType.getTypeItem/0#dispred#83467854` CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0, Rhs.1
         915101745   ~0%    {4}    | JOIN WITH `project#Type::DataType.getPositionalTypeParameter/1#dispred#3bf49cbe` ON FIRST 1 OUTPUT Lhs.2, _, Lhs.1, Lhs.0
         915101745   ~3%    {4}    | REWRITE WITH Out.1 := "Ref"
            124419   ~0%    {2}    | JOIN WITH `Builtins::BuiltinType.getName/0#dispred#8f62ab0a` ON FIRST 2 OUTPUT Lhs.2, Lhs.3

             76728   ~0%    {1} r2 = JOIN RefTypeRepr::Generated::RefTypeRepr#422893fa WITH `RefTypeRepr::Generated::RefTypeRepr.isMut/0#dispred#e2b9988f` ON FIRST 1 OUTPUT Lhs.0
        4083387432   ~1%    {3}    | JOIN WITH `Type::DataType.getTypeItem/0#dispred#83467854` CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0, Rhs.1
         564334440   ~3%    {4}    | JOIN WITH `project#Type::DataType.getPositionalTypeParameter/1#dispred#3bf49cbe` ON FIRST 1 OUTPUT Lhs.2, _, Lhs.1, Lhs.0
         564334440   ~0%    {4}    | REWRITE WITH Out.1 := "RefMut"
             76728   ~2%    {2}    | JOIN WITH `Builtins::BuiltinType.getName/0#dispred#8f62ab0a` ON FIRST 2 OUTPUT Lhs.2, Lhs.3

            201147   ~1%    {2} r3 = r1 UNION r2
                            return r3
```

After
```
Evaluated relational algebra for predicate TypeMention::RefTypeReprMention.resolveRootType/0#dispred#091b949a#fb@8f12aa2a with tuple counts:
        124419   ~0%    {1} r1 = RefTypeRepr::Generated::RefTypeRepr#422893fa AND NOT `RefTypeRepr::Generated::RefTypeRepr.isMut/0#dispred#e2b9988f`(FIRST 1)
        124419   ~0%    {2}    | JOIN WITH Type::RefSharedType#090df68e CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0
        124419   ~0%    {2}    | JOIN WITH `project#Type::DataType.getPositionalTypeParameter/1#dispred#3bf49cbe` ON FIRST 1 OUTPUT Lhs.1, Lhs.0

         76728   ~0%    {1} r2 = JOIN RefTypeRepr::Generated::RefTypeRepr#422893fa WITH `RefTypeRepr::Generated::RefTypeRepr.isMut/0#dispred#e2b9988f` ON FIRST 1 OUTPUT Lhs.0
         76728   ~0%    {2}    | JOIN WITH Type::RefMutType#c67a1837 CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0
         76728   ~2%    {2}    | JOIN WITH `project#Type::DataType.getPositionalTypeParameter/1#dispred#3bf49cbe` ON FIRST 1 OUTPUT Lhs.1, Lhs.0

        201147   ~1%    {2} r3 = r1 UNION r2
                        return r3
```
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Before
```
Evaluated relational algebra for predicate _ElementImpl::Impl::MacroExpansion::isAttributeMacroExpansionSourceLocation/2#3429148c_Locatable::Lo__#antijoin_rhs@9f4aa4rk with tuple counts:
        5127263380  ~4%    {3} r1 = JOIN `_AstNodeImpl::Impl::AstNode#22e758cf_ElementImpl::Impl::MacroExpansion::getATokenTreeNode/1#a2df59a3__#shared` WITH `ElementImpl::Impl::MacroExpansion::isAttributeMacroExpansionSourceLocation/2#3429148c` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.0
            305226  ~0%    {2}    | JOIN WITH `Locatable::Locatable.getLocation/0#dispred#f3f7e2b2` ON FIRST 2 OUTPUT Lhs.0, Lhs.2
                           return r1
```

(No After; the predicate is no longer generated)
JS: Add support for props callbacks in Vue router configs
JS: Skip minified file if avg line length > 200
Release preparation for version 2.24.0
Compatible with the latest released version of the CodeQL CLI
case 0:
return;
case 143 when attempt < 3:
HandleRetryExitCode143(dotnetCliInvoker.Exec, attempt, logger);

Check notice

Code scanning / CodeQL

Call to System.IO.Path.Combine Note

Call to 'System.IO.Path.Combine'.

Copilot Autofix

AI about 18 hours ago

In general, to avoid Path.Combine silently discarding earlier path segments when later arguments are absolute, prefer Path.Join for simple concatenation of path segments when you do not want this “absolute path wins” behavior. Path.Join will simply concatenate segments with the correct directory separator, without treating an absolute later component as resetting the path.

The best targeted fix here is to replace Path.Combine(tempWorkingDirectory.ToString(), "emptyFakeDotnetRoot") with Path.Join(tempWorkingDirectory.ToString(), "emptyFakeDotnetRoot"). Both methods live in System.IO.Path, so no new imports are required. This change preserves all existing behavior for the current arguments (base directory plus a relative folder name) while guarding against future accidental introduction of an absolute path segment that would otherwise cause Path.Combine to drop the earlier part. The change is localized to GetRestoreArgs in csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs, near line 76, and no other logic needs to be updated.

Suggested changeset 1
csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs
@@ -73,7 +73,7 @@
                 var path = ".empty";
                 if (tempWorkingDirectory != null)
                 {
-                    path = Path.Combine(tempWorkingDirectory.ToString(), "emptyFakeDotnetRoot");
+                    path = Path.Join(tempWorkingDirectory.ToString(), "emptyFakeDotnetRoot");
                     Directory.CreateDirectory(path);
                 }
 
EOF
@@ -73,7 +73,7 @@
var path = ".empty";
if (tempWorkingDirectory != null)
{
path = Path.Combine(tempWorkingDirectory.ToString(), "emptyFakeDotnetRoot");
path = Path.Join(tempWorkingDirectory.ToString(), "emptyFakeDotnetRoot");
Directory.CreateDirectory(path);
}

Copilot is powered by AI and may make mistakes. Always verify output.
// Finally look for language specific project files, e.g. `.csproj` files
ret = FindFiles(this.Options.Language.ProjectExtension, f => new Project<TAutobuildOptions>(this, f))?.ToList();
ret = FindFiles(Options.Language.ProjectExtension, f => new Project<TAutobuildOptions>(this, f))?.ToList();

Check notice

Code scanning / CodeQL

Call to System.IO.Path.Combine Note

Call to 'System.IO.Path.Combine'.

Copilot Autofix

AI about 18 hours ago

Copilot could not generate an autofix suggestion

Copilot could not generate an autofix suggestion for this alert. Try pushing a new commit or if the problem persists contact support.

@dilanbhalla dilanbhalla merged commit c4a73dd into main Jan 26, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.