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

Exception when using multiple return values #1044

Open
m1cm1c opened this issue Dec 11, 2020 · 0 comments
Open

Exception when using multiple return values #1044

m1cm1c opened this issue Dec 11, 2020 · 0 comments

Comments

@m1cm1c
Copy link
Contributor

m1cm1c commented Dec 11, 2020

I am not sure whether this is already possible.

I'm specifying ASTs and am creating CPGs from them. I had some trouble finding out how return values need to be specified. I think that there needs to be a gap of 1 between the last order of an input parameter (METHOD_PARAMETER_IN) and the order of the (first) return value (METHOD_RETURN). This seems to work reliably as long as there only is 1 return value.

Are multiple return values already possible?

Both if I increment order further for a second return value and if I leave it just the same as ther first return value's order, I get this error message:

[error] (Writer) java.lang.RuntimeException: Edge of type CFG with direction OUT not supported by class MethodReturnDb
[error] java.lang.RuntimeException: Edge of type CFG with direction OUT not supported by class MethodReturnDb
[error]         at overflowdb.NodeDb.storeAdjacentNode(NodeDb.java:621)
[error]         at overflowdb.NodeDb.storeAdjacentNode(NodeDb.java:602)
[error]         at overflowdb.NodeDb.addEdge(NodeDb.java:298)
[error]         at overflowdb.NodeRef.addEdge(NodeRef.java:151)
[error]         at overflowdb.SemiEdge.$minus$minus$greater(SyntacticSugar.scala:59)
[error]         at io.shiftleft.passes.DiffGraph$Applier.odbAddEdge(DiffGraph.scala:388)
[error]         at io.shiftleft.passes.DiffGraph$Applier.addEdge(DiffGraph.scala:380)
[error]         at io.shiftleft.passes.DiffGraph$Applier.$anonfun$run$1(DiffGraph.scala:332)
[error]         at io.shiftleft.passes.DiffGraph$Applier.$anonfun$run$1$adapted(DiffGraph.scala:328)
[error]         at scala.collection.IterableOnceOps.foreach(IterableOnce.scala:576)
[error]         at scala.collection.IterableOnceOps.foreach$(IterableOnce.scala:574)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1196)
[error]         at io.shiftleft.passes.DiffGraph$Applier.run(DiffGraph.scala:328)
[error]         at io.shiftleft.passes.DiffGraph$Applier$.applyDiff(DiffGraph.scala:417)
[error]         at io.shiftleft.passes.ParallelCpgPass$Writer.run(ParallelCpgPass.scala:105)
[error]         at java.lang.Thread.run(Thread.java:748)

It is thrown only when building the CPG, not when just specifying the AST.

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

1 participant