Skip to content

Commit 833bd43

Browse files
committed
Support string length
1 parent 62d71aa commit 833bd43

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import io.ksmt.utils.asExpr
55
import org.jacodb.ets.model.EtsAnyType
66
import org.jacodb.ets.model.EtsArrayType
77
import org.jacodb.ets.model.EtsLocal
8+
import org.jacodb.ets.model.EtsStringType
89
import org.jacodb.ets.model.EtsUnknownType
910
import org.usvm.UExpr
1011
import org.usvm.UHeapRef
@@ -30,6 +31,11 @@ fun TsContext.readLengthProperty(
3031
EtsArrayType(EtsUnknownType, dimensions = 1)
3132
}
3233

34+
is EtsStringType -> {
35+
// Strings are treated as arrays of characters (represented as strings).
36+
EtsArrayType(EtsStringType, dimensions = 1)
37+
}
38+
3339
else -> error("Expected EtsArrayType, EtsAnyType or EtsUnknownType, but got: $type")
3440
}
3541

0 commit comments

Comments
 (0)