Skip to content

Commit 0358e9e

Browse files
Fix: add rb_vm_rewind_cfp to blocking_operation_wait EC_PUSH_TAG
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 2a3643d commit 0358e9e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

scheduler.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,11 +1119,15 @@ VALUE rb_fiber_scheduler_blocking_operation_wait(VALUE scheduler, void* (*functi
11191119
VALUE result = Qundef;
11201120
enum ruby_tag_type tag_state;
11211121
rb_execution_context_t *ec = GET_EC();
1122+
rb_control_frame_t *volatile cfp = ec->cfp;
11221123

11231124
EC_PUSH_TAG(ec);
11241125
if ((tag_state = EC_EXEC_TAG()) == TAG_NONE) {
11251126
result = rb_funcall(scheduler, id_blocking_operation_wait, 1, blocking_operation);
11261127
}
1128+
else {
1129+
rb_vm_rewind_cfp(ec, cfp);
1130+
}
11271131
EC_POP_TAG();
11281132

11291133
// The scheduler's blocking_operation_wait hook has returned (or raised).

0 commit comments

Comments
 (0)