Merge pull request #19510 from GeekMasher/cpp-wmain

C/CPP: Update FlowSources to add wmain
This commit is contained in:
Jeroen Ketema
2025-05-19 10:33:35 +02:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* Added support for `wmain` as part of the ArgvSource model.

View File

@@ -55,12 +55,12 @@ private class LocalModelSource extends LocalFlowSource {
}
/**
* A local data flow source that the `argv` parameter to `main`.
* A local data flow source that the `argv` parameter to `main` or `wmain`.
*/
private class ArgvSource extends LocalFlowSource {
ArgvSource() {
exists(Function main, Parameter argv |
main.hasGlobalName("main") and
main.hasGlobalName(["main", "wmain"]) and
main.getParameter(1) = argv and
this.asParameter(2) = argv
)