File tree Expand file tree Collapse file tree 3 files changed +32
-9
lines changed
usvm-ts/src/main/kotlin/org/usvm/machine Expand file tree Collapse file tree 3 files changed +32
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ object Versions {
6
6
const val clikt = " 5.0.0"
7
7
const val detekt = " 1.23.7"
8
8
const val ini4j = " 0.5.4"
9
- const val jacodb = " 4ff7243d3a "
9
+ const val jacodb = " 77b83e4127 "
10
10
const val juliet = " 1.3.2"
11
11
const val junit = " 5.9.3"
12
12
const val kotlin = " 2.1.0"
Original file line number Diff line number Diff line change @@ -6,10 +6,10 @@ import org.jacodb.ets.model.EtsAliasType
6
6
import org.jacodb.ets.model.EtsAnyType
7
7
import org.jacodb.ets.model.EtsArrayType
8
8
import org.jacodb.ets.model.EtsBooleanType
9
+ import org.jacodb.ets.model.EtsEnumValueType
9
10
import org.jacodb.ets.model.EtsGenericType
10
11
import org.jacodb.ets.model.EtsNullType
11
12
import org.jacodb.ets.model.EtsNumberType
12
- import org.jacodb.ets.model.EtsRawType
13
13
import org.jacodb.ets.model.EtsRefType
14
14
import org.jacodb.ets.model.EtsScene
15
15
import org.jacodb.ets.model.EtsStringType
@@ -82,12 +82,9 @@ class TsContext(
82
82
TODO (" Not yet implemented" )
83
83
}
84
84
}
85
+ is EtsEnumValueType -> unresolvedSort
85
86
else -> {
86
- if (type is EtsRawType && type.kind == " EnumValueType" ) {
87
- unresolvedSort
88
- } else {
89
- TODO (" ${type::class .simpleName} is not yet supported: $type " )
90
- }
87
+ TODO (" ${type::class .simpleName} is not yet supported: $type " )
91
88
}
92
89
}
93
90
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ import org.jacodb.ets.model.EtsPreDecExpr
55
55
import org.jacodb.ets.model.EtsPreIncExpr
56
56
import org.jacodb.ets.model.EtsPtrCallExpr
57
57
import org.jacodb.ets.model.EtsRawType
58
+ import org.jacodb.ets.model.EtsRefType
58
59
import org.jacodb.ets.model.EtsRemExpr
59
60
import org.jacodb.ets.model.EtsRightShiftExpr
60
61
import org.jacodb.ets.model.EtsStaticCallExpr
@@ -270,8 +271,33 @@ class TsExprResolver(
270
271
}
271
272
272
273
override fun visit (expr : EtsCastExpr ): UExpr <* >? = with (ctx) {
273
- logger.warn { " visit(${expr::class .simpleName} ) is not implemented yet" }
274
- error(" Not supported $expr " )
274
+ val resolvedExpr = resolve(expr.arg) ? : return @with null
275
+ return when (resolvedExpr.sort) {
276
+ fp64Sort -> {
277
+ TODO ()
278
+ }
279
+
280
+ boolSort -> {
281
+ TODO ()
282
+ }
283
+
284
+ addressSort -> {
285
+ scope.calcOnState {
286
+ val instance = resolvedExpr.asExpr(addressSort)
287
+
288
+ if (expr.type !is EtsRefType ) {
289
+ TODO (" Not supported yet" )
290
+ }
291
+
292
+ pathConstraints + = memory.types.evalIsSubtype(instance, expr.type)
293
+ instance
294
+ }
295
+ }
296
+
297
+ else -> {
298
+ error(" Unsupported cast from ${expr.arg} to ${expr.type} " )
299
+ }
300
+ }
275
301
}
276
302
277
303
override fun visit (expr : EtsTypeOfExpr ): UExpr <out USort >? = with (ctx) {
You can’t perform that action at this time.
0 commit comments