Skip to content

Commit

Permalink
Executor module updated to actual usvm with some improvements and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniilStepanov committed Oct 9, 2023
1 parent aad21bb commit 95cba97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import org.usvm.collection.array.UArrayIndexLValue
import org.usvm.collection.array.length.UArrayLengthLValue
import org.usvm.collection.field.UFieldLValue
import org.usvm.model.UModelBase
import org.usvm.sizeSort
import org.usvm.types.first
import org.usvm.types.firstOrNull

Expand Down Expand Up @@ -208,7 +209,7 @@ class JcTestInterpreter(

private fun resolveArray(ref: UConcreteHeapRef, heapRef: UHeapRef, type: JcArrayType): Any {
val arrayDescriptor = ctx.arrayDescriptorOf(type)
val lengthRef = UArrayLengthLValue(heapRef, arrayDescriptor)
val lengthRef = UArrayLengthLValue(heapRef, arrayDescriptor, ctx.sizeSort)
val resolvedLength = resolveLValue(lengthRef, ctx.cp.int) as Int
val length = if (resolvedLength in 0..10_000) resolvedLength else 0 // TODO hack

Expand Down
2 changes: 1 addition & 1 deletion usvm-jvm/src/test/kotlin/org/usvm/util/JcTestExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ class JcTestExecutor(
ref: UConcreteHeapRef, heapRef: UHeapRef, type: JcArrayType
): Pair<UTestExpression, List<UTestInst>> {
val arrayDescriptor = ctx.arrayDescriptorOf(type)
val lengthRef = UArrayLengthLValue(heapRef, arrayDescriptor)
val lengthRef = UArrayLengthLValue(heapRef, arrayDescriptor, ctx.sizeSort)
val resolvedLength = resolveLValue(lengthRef, ctx.cp.int).first as UTestIntExpression
// TODO hack
val length =
Expand Down

0 comments on commit 95cba97

Please sign in to comment.