patches: move block_input fix to 0001 where pattern is introduced

The block_input/record_unwind_protect_void ordering fix and its
explanatory comment belong in 0001 (ns_ax_buffer_text), which is
where the pattern is first introduced.  Having the fragile pattern
visible across patches 0001-0007 invites review comments.

Remove the now-redundant block_input reordering hunk from 0008;
0001 already establishes the correct order with the comment.
This commit is contained in:
2026-03-03 13:31:00 +01:00
parent 2dc23e64df
commit 3a3fbbac19
2 changed files with 6 additions and 17 deletions

View File

@@ -318,21 +318,6 @@ index 8ef344d9fe..1acb64630a 100644
/* Build accessibility text for window W, skipping invisible text.
Populates *OUT_START with the buffer start charpos.
Populates *OUT_RUNS with an array of visible runs and *OUT_NRUNS
@@ -7440,9 +7557,13 @@ visual line index for Zoom (skip whitespace-only lines
return @"";
specpdl_ref count = SPECPDL_INDEX ();
+ /* block_input must precede record_unwind_protect_void (unblock_input):
+ if anything between SPECPDL_INDEX and block_input were to throw,
+ the unwind handler would call unblock_input without a matching
+ block_input, corrupting the input-blocking reference count. */
+ block_input ();
record_unwind_current_buffer ();
record_unwind_protect_void (unblock_input);
- block_input ();
if (b != current_buffer)
set_buffer_internal_1 (b);
@@ -8605,6 +8726,11 @@ - (void)setAccessibilitySelectedTextRange:(NSRange)range
[self ensureTextCache];