Skip to content

Commit 5ed9332

Browse files
committed
Tmp commit
1 parent bc7c382 commit 5ed9332

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

usvm-ts/src/main/kotlin/org/usvm/machine/expr/TsExprResolver.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,15 +663,18 @@ class TsExprResolver(
663663
isSigned = true,
664664
).asExpr(sizeSort)
665665

666+
// TODO add test for array as parameter and reading as parameter, seems like it produces not fake object
666667
val lValue = mkArrayIndexLValue(
667668
sort = addressSort,
668669
ref = array,
669670
index = bvIndex,
670-
type = value.array.type as EtsArrayType
671+
type = EtsArrayType(EtsUnknownType, 1)
671672
)
672673
val expr = scope.calcOnState { memory.read(lValue) }
673674

674-
check(expr.isFakeObject()) { "Only fake objects are allowed in arrays" }
675+
check(expr.isFakeObject()) {
676+
"Only fake objects are allowed in arrays"
677+
}
675678

676679
return expr
677680
}

usvm-ts/src/main/kotlin/org/usvm/machine/interpreter/TsInterpreter.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ class TsInterpreter(
127127
is EtsCallStmt -> visitCallStmt(scope, stmt)
128128
is EtsThrowStmt -> visitThrowStmt(scope, stmt)
129129
is EtsNopStmt -> visitNopStmt(scope, stmt)
130-
else -> error("Unknown stmt: $stmt")
130+
else -> {
131+
logger.error { "Unknown stmt: $stmt" }
132+
scope.doWithState {
133+
newStmt(graph.successors(stmt).single())
134+
}
135+
}
131136
}
132137
} catch (e: Exception) {
133138
logger.error {
@@ -488,12 +493,14 @@ class TsInterpreter(
488493
expr.extractBool(scope)
489494
}
490495
}
496+
491497
is EtsNumberType -> {
492498
scope.calcOnState {
493499
pathConstraints += expr.getFakeType(scope).fpTypeExpr
494500
expr.extractFp(scope)
495501
}
496502
}
503+
497504
else -> {
498505
scope.calcOnState {
499506
pathConstraints += expr.getFakeType(scope).refTypeExpr

0 commit comments

Comments
 (0)