fix infinite loop in shop
This commit is contained in:
@@ -850,9 +850,14 @@ static inline objhdr_t *chase(JSValue v) {
|
||||
updated to follow the chain to the live copy. */
|
||||
static inline void mach_resolve_forward(JSValue *slot) {
|
||||
if (JS_IsPtr(*slot)) {
|
||||
objhdr_t h = *(objhdr_t *)JS_VALUE_GET_PTR(*slot);
|
||||
if (objhdr_type(h) == OBJ_FORWARD) {
|
||||
*slot = JS_MKPTR(objhdr_fwd_ptr(h));
|
||||
objhdr_t *oh = (objhdr_t *)JS_VALUE_GET_PTR(*slot);
|
||||
if (objhdr_type(*oh) == OBJ_FORWARD) {
|
||||
do {
|
||||
objhdr_t *next = (objhdr_t *)objhdr_fwd_ptr(*oh);
|
||||
if (!next) break;
|
||||
oh = next;
|
||||
} while (objhdr_type(*oh) == OBJ_FORWARD);
|
||||
*slot = JS_MKPTR(oh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user