Skip to content

Commit

Permalink
Workaround: run concrete execution for invokedynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
dtim committed Jul 5, 2022
1 parent 65d95c1 commit 1d48789
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,7 @@ class UtBotSymbolicEngine(
is JInterfaceInvokeExpr -> virtualAndInterfaceInvoke(invokeExpr.base, invokeExpr.methodRef, invokeExpr.args)
is JVirtualInvokeExpr -> virtualAndInterfaceInvoke(invokeExpr.base, invokeExpr.methodRef, invokeExpr.args)
is JSpecialInvokeExpr -> specialInvoke(invokeExpr)
is JDynamicInvokeExpr -> TODO("$invokeExpr")
is JDynamicInvokeExpr -> dynamicInvoke(invokeExpr)
else -> error("Unknown class ${invokeExpr::class}")
}

Expand Down Expand Up @@ -2731,6 +2731,15 @@ class UtBotSymbolicEngine(
return commonInvokePart(invocation)
}

private fun dynamicInvoke(invokeExpr: JDynamicInvokeExpr): List<MethodResult> {
workaround(HACK) {
// The engine does not yet support JDynamicInvokeExpr, so switch to concrete execution if we encounter it
statesForConcreteExecution += environment.state
queuedSymbolicStateUpdates += UtFalse.asHardConstraint()
return emptyList()
}
}

/**
* Runs common invocation part for object wrapper or object instance.
*
Expand Down

0 comments on commit 1d48789

Please sign in to comment.