@@ -6,6 +6,8 @@ import org.jacodb.ets.model.EtsAliasType
66import org.jacodb.ets.model.EtsAnyType
77import org.jacodb.ets.model.EtsArrayType
88import org.jacodb.ets.model.EtsBooleanType
9+ import org.jacodb.ets.model.EtsEnumValueType
10+ import org.jacodb.ets.model.EtsGenericType
911import org.jacodb.ets.model.EtsNullType
1012import org.jacodb.ets.model.EtsNumberType
1113import org.jacodb.ets.model.EtsRefType
@@ -29,10 +31,12 @@ import org.usvm.api.allocateConcreteRef
2931import org.usvm.api.typeStreamOf
3032import org.usvm.collection.field.UFieldLValue
3133import org.usvm.isTrue
34+ import org.usvm.machine.Constants.Companion.MAGIC_OFFSET
3235import org.usvm.machine.expr.TsUndefinedSort
3336import org.usvm.machine.expr.TsUnresolvedSort
3437import org.usvm.machine.expr.TsVoidSort
3538import org.usvm.machine.expr.TsVoidValue
39+ import org.usvm.machine.expr.tctx
3640import org.usvm.machine.interpreter.TsStepScope
3741import org.usvm.machine.types.EtsFakeType
3842import org.usvm.memory.UReadOnlyMemory
@@ -76,6 +80,16 @@ class TsContext(
7680 is EtsAnyType -> unresolvedSort
7781 is EtsUnknownType -> unresolvedSort
7882 is EtsAliasType -> typeToSort(type.originalType)
83+ is EtsEnumValueType -> unresolvedSort
84+
85+ is EtsGenericType -> {
86+ if (type.constraint == null && type.defaultType == null ) {
87+ unresolvedSort
88+ } else {
89+ TODO (" Not yet implemented" )
90+ }
91+ }
92+
7993 else -> TODO (" ${type::class .simpleName} is not yet supported: $type " )
8094 }
8195
@@ -152,6 +166,22 @@ class TsContext(
152166 }
153167 }
154168
169+ fun UHeapRef.unwrapRef (scope : TsStepScope ): UHeapRef {
170+ if (isFakeObject()) {
171+ return extractRef(scope)
172+ }
173+ return this
174+ }
175+
176+ fun UHeapRef.unwrapRefWithPathConstraint (scope : TsStepScope ): UHeapRef = with (tctx) {
177+ if (this @unwrapRefWithPathConstraint.isFakeObject()) {
178+ scope.assert (getFakeType(scope).refTypeExpr)
179+ extractRef(scope)
180+ } else {
181+ asExpr(addressSort)
182+ }
183+ }
184+
155185 fun createFakeObjectRef (): UConcreteHeapRef {
156186 val address = mkAddressCounter().freshAllocatedAddress() + MAGIC_OFFSET
157187 return mkConcreteHeapRef(address)
@@ -235,7 +265,13 @@ class TsContext(
235265 }
236266}
237267
238- const val MAGIC_OFFSET = 1000000
268+ class Constants {
269+ companion object {
270+ const val STATIC_METHODS_FORK_LIMIT = 5
271+ const val MAGIC_OFFSET = 1000000
272+ }
273+ }
274+
239275
240276enum class IntermediateLValueField {
241277 BOOL , FP , REF
0 commit comments