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

Clarifications about which Joern output nodes are being used #9

Open
davidhin opened this issue May 11, 2021 · 2 comments
Open

Clarifications about which Joern output nodes are being used #9

davidhin opened this issue May 11, 2021 · 2 comments

Comments

@davidhin
Copy link

In the following code:

cfgNode = node['isCFGNode'].strip()
if not cfg_only and (cfgNode == '' or cfgNode == 'False'):
continue

It seems like you're only using CFG nodes from Joern's output, and discarding the rest. Is this correct?

@davidhin
Copy link
Author

davidhin commented May 12, 2021

Upon closer inspection, the cfg_only boolean appears to be the reverse of what it should be. We would expect that

  • if cfg_only is true, then we are only keeping cfg nodes.
  • If cfg_only is false, we are keeping non_cfgs as well.

However, what this code is actually doing, is the reverse, due to the not cfg_only condition. Is this intended behaviour? It results in graph_input_full actually missing many nodes, as it is only keeping CFG nodes, which is not what "full" suggests.

graph_input_full = inputGeneration(
nodes_path, edges_path, label, model, edgeType_full, False)

If you check the output of the above, compare it with cfg_only = True and cfg_only = False.

tl;dr which ggnn input should we generate to replicate the results? In the provided data, for example, data/ggnn_input/devign has cfg, cfg_dfg, and dfg. I.e. no AST. But in the paper, you mention using CPG, which includes AST

@for-just-we
Copy link

what

I presume he use python clang API to parse the statement(node) in CFG into AST, because the AST node is in a extent independent from CFG edge and PDG edge. I don't know whether I assume the right thing.

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

No branches or pull requests

2 participants