module scheme fn test_native_private_wind_existing_continuation_exit_keeps_real_extent() { mut vm := new_with_options(Options{max_steps: 0, max_frames: 0})! vm.eval('(define out #f) (call/cc (lambda (k) (set! out k) 42))')! vm.eval('(define (work k v) (dynamic-wind (lambda () (vector-set! v 0 (+ (vector-ref v 0) 1))) (lambda () (k 99)) (lambda () (vector-set! v 0 (+ (vector-ref v 0) 10)))))')! v := vm.eval('(vector 0)')! gc_collect() vm.with_native_execution(fn [v] (mut vm VM) !Value { assert vm.call(vm.lookup('work')!, [vm.lookup('out')!, v])!.whole() == 99 assert write(v)! == '#(11)' // Flattened native wind extents cannot admit continuation exits. // Future native escape support must retain this decline, or explicitly // model wind exits before changing this admission expectation. scope := unsafe { &NativeScope(vm.native_execution_scope) } root := vm.lookup('work')!.procedure_pointer().function assert !scope.plans.any(voidptr(it.root) == voidptr(root) && !it.disabled) return unspecified() })! }