-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16458 from owen-mc/go/fix-mad-for-builtin-functions
Go: fix `hasQualifiedName` and models-as-data for built-in functions
- Loading branch information
Showing
6 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
go/ql/lib/change-notes/2024-05-08-builtin-functions-no-package.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
category: minorAnalysis | ||
--- | ||
* Fixed a bug that stopped built-in functions from being referenced using the predicate `hasQualifiedName` because technically they do not belong to any package. Now you can use the empty string as the package, e.g. `f.hasQualifiedName("", "len")`. | ||
* Fixed a bug that stopped data flow models for built-in functions from having any effect because the package "" was not parsed correctly. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
go/ql/test/library-tests/semmle/go/dataflow/FlowSteps/LocalFlowStep.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import go | ||
|
||
from DataFlow::Node nd, DataFlow::Node succ | ||
where DataFlow::localFlowStep(nd, succ) | ||
where | ||
DataFlow::localFlowStep(nd, succ) and | ||
(exists(nd.getFile()) or exists(succ.getFile())) | ||
select nd, succ |
4 changes: 3 additions & 1 deletion
4
go/ql/test/library-tests/semmle/go/dataflow/PromotedFields/LocalFlowStep.ql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import go | ||
|
||
from DataFlow::Node nd, DataFlow::Node succ | ||
where DataFlow::localFlowStep(nd, succ) | ||
where | ||
DataFlow::localFlowStep(nd, succ) and | ||
(exists(nd.getFile()) or exists(succ.getFile())) | ||
select nd, succ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters