Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 4-0-159 to backup_sync #153

Open
wants to merge 273 commits into
base: backup_sync
Choose a base branch
from
Open

Merge 4-0-159 to backup_sync #153

wants to merge 273 commits into from

Conversation

github-actions[bot]
Copy link

Created by Github action

johannescoetzee and others added 30 commits July 4, 2024 17:01
…oernio#4733)

* Fix always-crashing array initializer type resolution

* Fix exception when trying to cast ArrayType to ClassOrInterfaceType

* Fix formatting
…g merge (joernio#4737)

* minify the flatgraph diff by bringing various things in before the big merge

* fmt

* revert accidental change
For new frontends with potentially malformed ASTs, type recovery must safely handle instances where members don't have AST parents.
The parser emits calls to `super` as different from simple calls, this PR handles them.
Also: no more empty method fullnames
* Safely handles the case when `super` call has a `null` argument from the parser
* Shadows keywords when they are used as keys in association keys for named arguments in calls
* Handles singleton methods in implicit returns
This PR fixes a bug where method members were not correctly linked to surrounding methods' bound type decls. Additionally, this handles `return` statements without any proceeding expression.

Resolves joernio#4732
The initial implementation of the edge creation and captured local node was wrongly added to the `Ast` object instead of the diff graph. This PR rectifies this.
Due to Ruby method references being called via a `.call()` method, the type ref that should be emitted, is one that contains the `.call` method, but is not necessarily the same type as the one bound to the actual lambda. This makes that change, however, data-flow no longer works in the open-source data-flow tracker as this is not supported.
* [ruby] Remodelled methods defined on singleton objects to no longer be lambdas

* [ruby] Review comments
* Renamed `:program` to `<main>`
* Replaced `:` method separator to `.`
* Removed `<global>` from full names of types and methods
In the case of a type or method re-definition, the full name is ensured to be unique by a set that tracks all full-names for that compilation unit, and a counter.

Resolves joernio#4742
This PR remodels `yield` calls as explicit invocations of the implicit or explicit block parameter of the surrounding method.

Resolves joernio#4760
Getters and setters were modelled as their CPG operations in isolation, and not using the ordinary AST creator hooks. This PR lowers the getters and setters as their `RubyNode` equivalents, and hands off the AST creation to `astForMethodDeclaration`.
* [php2cpg] Support array/list unpacking in assignment

* [php2cpg] Rename method and fix some tests

* [php2cpg] code clean and improved test

* [php2cpg] improved test
)

* IF Cfg creation for if-statements with empty `then` block.

* Update joern-cli/frontends/c2cpg/src/test/scala/io/joern/c2cpg/passes/cfg/CfgCreationPassTests.scala

Co-authored-by: maltek <[email protected]>

---------

Co-authored-by: maltek <[email protected]>
- Changed test constructs used to test the CFG creation to return
  List instead of Set. This avoids deduplication which is required
  for correct tests because the number of edges between two nodes
  matters.

- The above change unveiled a problem with the for-statement CFG:
  Duplicate edge between loop condition and body
* [ruby] Moved precedence for keywords down, added special handling on local identifiers to check for keywords and member access

* [ruby] Finished test for member call with reserved keyword

* [ruby] remove debug print from RubyNodeCreator

* [ruby] Fixed edge case for reserved keywords

* [ruby] Added more checks for keyword handling, added test cases for :: syntax and having a base with the same name as a reserved keyword

* [ruby] Added antlr debug flag to ruby config

* [ruby] Added edge case for keyword handling
* [php2cpg] Support array/list unpacking in assignment

* [php2cpg] Rename method and fix some tests

* [php2cpg] code clean and improved test

* [php2cpg] improved test

* [php2cpg] lowering the init part of foreach statement
…modifier (joernio#4768)

Fixes these org.eclipse.cdt.core.dom.ast.ExpansionOverlapsBoundaryException for `.getSyntax` calls.
DavidBakerEffendi and others added 30 commits November 11, 2024 13:45
* [ruby] Bitwise Assignment Operators
Added handling for `|=`, `&=`, `<<=`, and `>>=`

* Added tests
* Added handling for yield in Constructor

* Added common fields to traits
* Fixed lifting of fieldStmts causing type recovery to fall over. Changed typerecovery to use lastOption

* Revert iterations to 4
* kotlin2cpg: run cleanupDelombokOutput and clearJavaParserCaches after using the AstCreationPass from javasrc2cpg (somehow it was forgotten there)
* some minor cleanup/refactoring
It's mostly upper-casing constants.
* upgrade ghidra

* new try

* latest
Desugars aliased methods to the form
```ruby
def new_name(*args, &block)
  old_name(*args, &block)
end
```
Resolves joernio#5110
usage example for extension mechanism:
```
echo 'Help.additionalHelpEntries += (("aa", "bb", "cc"))' > test-help.sc
./joern --import test-help.sc

joern> help
...
┌────────────────┬────────────────┬─────────────────────────┐
│command         │description     │example                  │
├────────────────┼────────────────┼─────────────────────────┤
│aa              │bb              │cc                       │
...
```
…5122)

* Fixed warning on calling function that shadows a reserved keyword

* Moved lowering to AstCreator
joernio#5097)" (joernio#5124)

This reverts commit 16f9541.

See source code comment for further details.
* Lower field decls in inlucded block to directly under class

* Added test for multiple lowering
…#5129)

The linking of captured variables was not yet working if variables from
outside of a class have been captured into methods of a class.
This was the case because of a possible name clashes between those
captured variables and variables inside of the class body methods.
To avoid such clashes captures variables get a `<captured>` prefix
inside the class body methods.
This solves a long standing issue where data flows via such captured
variables were not found.
* Moved alias lowering to AstCreator. Added handling to moved method def from <body> to under type_decl

* Style changes
joernio#5127 made `BabelJsonParser.readFile` a bit safer by simply
wrapping everything into a big try.

This PR changes that to:
 - separate Try blocks for type map loading, json loading, and parse result generation
 - forward exceptions from json loading and parse result generation to `AstCreationPass.runOnPart`, and
 - do a proper WARN logging of these exceptions
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.