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

[Bug] KwRestArg value is sometimes not ujson.Str #5065

Closed
DavidBakerEffendi opened this issue Nov 6, 2024 · 0 comments · Fixed by #5079
Closed

[Bug] KwRestArg value is sometimes not ujson.Str #5065

DavidBakerEffendi opened this issue Nov 6, 2024 · 0 comments · Fixed by #5079
Assignees
Labels
bug Something isn't working ruby Relates to rubysrc2cpg

Comments

@DavidBakerEffendi
Copy link
Collaborator

Describe the bug
On mastodon, we see the value field not being a string, and this is not being handled gracefully.

// RubyJsonToNodeCreator
  private def visitKwRestArg(obj: Obj): RubyExpression = {
    val name = obj(ParserKeys.Value).str // <-- here
    HashParameter(name)(obj.toTextSpan)
  }

To Reproduce
Steps to reproduce the behavior:

  1. git clone [email protected]:mastodon/mastodon.git --depth 1
  2. joern-parse mastodon
  3. See error
@DavidBakerEffendi DavidBakerEffendi added bug Something isn't working ruby Relates to rubysrc2cpg labels Nov 6, 2024
@DavidBakerEffendi DavidBakerEffendi self-assigned this Nov 8, 2024
DavidBakerEffendi added a commit that referenced this issue Nov 8, 2024
* Convert `FieldIdentifier` nodes to `MemberAccess` if they reach AstCreator for call targets
* Handle forwarded args which were a cause for some null pointer exceptions
* Fixed `kwrestarg` null value issue, which turned out to be a `**` parameter

Resolves #5063
Resolves #5064
Resolves #5065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ruby Relates to rubysrc2cpg
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant