Skip to content

Commit

Permalink
Make the JVM frontend compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Jul 31, 2024
1 parent 0514aec commit 158a37a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ fun <T : Node> T.withChildren(
return this
}

class AstProperty<PropertyType : Node, NodeType : Node>(
class AstProperty<PropertyType : Node?, NodeType : Node>(
initializer: PropertyType,
var pre: ((PropertyType) -> Unit)? = null,
var post: ((PropertyType) -> Unit)? = null
Expand All @@ -440,7 +440,7 @@ class AstProperty<PropertyType : Node, NodeType : Node>(
pre?.let { it(storage) }

storage = value
storage.astParent = thisRef
storage?.astParent = thisRef

post?.let { it(storage) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ open class CallExpression : Expression(), HasType.TypeObserver, ArgumentHolder {
* but will be in the future. In most cases, this is a [Reference] and its [Reference.refersTo]
* is intentionally left empty. It is not filled by the [SymbolResolver].
*/
@AST var callee: Expression? = null
var callee: Expression? by AstProperty(initializer = ProblemExpression("missing callee"))

/**
* The [Name] of this call expression, based on its [callee].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import de.fraunhofer.aisec.cpg.*
import de.fraunhofer.aisec.cpg.graph.*
import de.fraunhofer.aisec.cpg.graph.statements.expressions.*
import de.fraunhofer.aisec.cpg.graph.types.PointerType
import de.fraunhofer.aisec.cpg.passes.EdgeCachePass
import de.fraunhofer.aisec.cpg.passes.astParent
import de.fraunhofer.aisec.cpg.test.analyze
import de.fraunhofer.aisec.cpg.test.analyzeAndGetFirstTU
import de.fraunhofer.aisec.cpg.test.assertFullName
Expand Down Expand Up @@ -97,7 +95,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand Down Expand Up @@ -162,7 +159,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(result)
Expand All @@ -186,7 +182,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand All @@ -205,7 +200,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand Down Expand Up @@ -283,7 +277,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand Down Expand Up @@ -320,7 +313,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand All @@ -342,7 +334,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand Down Expand Up @@ -413,7 +404,6 @@ class JVMLanguageFrontendTest {
topLevel,
true
) {
it.registerPass<EdgeCachePass>()
it.registerLanguage<JVMLanguage>()
}
assertNotNull(tu)
Expand Down

0 comments on commit 158a37a

Please sign in to comment.