Skip to content

Commit b958523

Browse files
committed
Use allocated ref, improve comment
1 parent 421bd73 commit b958523

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

usvm-ts/src/main/kotlin/org/usvm/machine/TsContext.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ class TsContext(
269269
}
270270
}
271271

272-
// This is a special function that resolves promises in the interpreter.
272+
// This is an identifier for a special function representing the 'resolve' function used in promises.
273273
// It is not a real function in the code, but we need it to handle promise resolution.
274-
val resolveFunctionRef: UConcreteHeapRef = mkConcreteHeapRef(addressCounter.freshStaticAddress())
274+
val resolveFunctionRef: UConcreteHeapRef = allocateConcreteRef()
275275

276-
// This is a special function that rejects promises in the interpreter.
276+
// This is an identifier for a special function representing the 'reject' function used in promises.
277277
// It is not a real function in the code, but we need it to handle promise rejection.
278-
val rejectFunctionRef: UConcreteHeapRef = mkConcreteHeapRef(addressCounter.freshStaticAddress())
278+
val rejectFunctionRef: UConcreteHeapRef = allocateConcreteRef()
279279
}
280280

281281
class Constants {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ class TsExprResolver(
977977
is TsMethodResult.NoCall -> {
978978
val ptr = resolve(expr.ptr) ?: return null
979979

980-
if (isStaticHeapRef(ptr)) {
980+
if (isAllocatedConcreteHeapRef(ptr)) {
981981
// Handle 'resolve' and 'reject' function call
982982
if (ptr === resolveFunctionRef || ptr === rejectFunctionRef) {
983983
val promise = scope.calcOnState {

0 commit comments

Comments
 (0)