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] pysrc2cpg misidentified the dictionary parameters **k #4372

Open
cyw3 opened this issue Mar 20, 2024 · 0 comments
Open

[Bug] pysrc2cpg misidentified the dictionary parameters **k #4372

cyw3 opened this issue Mar 20, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@cyw3
Copy link
Contributor

cyw3 commented Mar 20, 2024

Describe the bug

When a dictionary parameter is passed to a method _request, the dictionary parameter is not found in the call node corresponding to the cpg obtained by Joern.

Please keep the conversation English! Make it easy for us and share your input code or a minified example.

To Reproduce
Steps to reproduce the behavior:

  1. Sample code
def request(*l, **k):
    _request(*l, **k)
  1. run joern:
$ ./joern

joern> importCode(inputPath="/data/test/python", projectName="python")
joern> run.ossdataflow
joern> cpg.method("request").call.l
val res3: List[io.shiftleft.codepropertygraph.generated.nodes.Call] = List(
  Call(
    id = 23L,
    argumentIndex = -1,
    argumentName = None,
    code = "_request(*l)",
    columnNumber = Some(value = 5),
    dispatchType = "DYNAMIC_DISPATCH",
    dynamicTypeHintFullName = ArraySeq(),
    lineNumber = Some(value = 3),
    methodFullName = "<unknownFullName>",
    name = "_request",
    order = 1,
    possibleTypes = ArraySeq(),
    signature = "",
    typeFullName = "ANY"
  ),
  Call(
    id = 21L,
    argumentIndex = 1,
    argumentName = None,
    code = "*l",
    columnNumber = Some(value = 14),
    dispatchType = "STATIC_DISPATCH",
    dynamicTypeHintFullName = ArraySeq(),
    lineNumber = Some(value = 3),
    methodFullName = "<operator>.starredUnpack",
    name = "<operator>.starredUnpack",
    order = 1,
    possibleTypes = ArraySeq(),
    signature = "",
    typeFullName = "ANY"
  )
)

It can be seen that in the call node _request(*l) corresponding to cpg, there are only *l parameters and no **k parameters.

Expected behavior
The corresponding call node should have **k parameters.

Desktop (please complete the following information):

  • OS
    centos 7.9
  • Joern Version
    v2.0.285
  • Java version
    jdk 19

Additional context
Add any other context about the problem here.

@cyw3 cyw3 added the bug Something isn't working label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants