From adced430863ce300ec5df996970a3af5ce514946 Mon Sep 17 00:00:00 2001 From: DaniilStepanov Date: Mon, 30 Oct 2023 15:08:21 +0300 Subject: [PATCH] Result execution state builds for exception result --- .../kotlin/org/usvm/instrumentation/rd/UTestExecutor.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usvm-jvm-instrumentation/src/main/kotlin/org/usvm/instrumentation/rd/UTestExecutor.kt b/usvm-jvm-instrumentation/src/main/kotlin/org/usvm/instrumentation/rd/UTestExecutor.kt index 9acfd3fb3f..011bb1a345 100644 --- a/usvm-jvm-instrumentation/src/main/kotlin/org/usvm/instrumentation/rd/UTestExecutor.kt +++ b/usvm-jvm-instrumentation/src/main/kotlin/org/usvm/instrumentation/rd/UTestExecutor.kt @@ -95,6 +95,10 @@ class UTestExecutor( else -> methodInvocationResult.getOrNull() } if (unpackedInvocationResult is Throwable) { + val trace = JcInstructionTracer.getTrace() + accessedStatics.addAll(trace.statics.toSet()) + val resultExecutionState = + buildExecutionState(callMethodExpr, executor, resultStateDescriptorBuilder, accessedStatics) return UTestExecutionExceptionResult( cause = buildExceptionDescriptor( builder = resultStateDescriptorBuilder, @@ -103,8 +107,7 @@ class UTestExecutor( ), trace = JcInstructionTracer.getTrace().trace, initialState = initExecutionState, - //TODO!!! decide if should we build resulting state - resultState = initExecutionState + resultState = resultExecutionState ) } val methodInvocationResultDescriptor =