perl/Module-Build-Tiny: update to 0.051 for Perl 5.36 and 5.38
[oi-userland.git] / components / shell / bash / patches / bash52-034.patch
blob17c0d669d88e3feb4a4f34eddec0a5717a2ef1df
1 BASH PATCH REPORT
2 =================
4 Bash-Release: 5.2
5 Patch-ID: bash52-034
7 Bug-Reported-by: Wiley Young <wyeth2485@gmail.com>
8 Bug-Reference-ID: <CAGnujaPrPV9hgbvdtG=fOs+L1zVGEahT9d3Aw0e1y3Qj8D8stw@mail.gmail.com>
9 Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-05/msg00146.html
11 Bug-Description:
13 If we parse a compound assignment during an alias expansion, it's possible
14 to have the current input string popped out from underneath the parse. In
15 this case, we should not restore the input we were using when we began to
16 parse the compound assignment.
18 Patch (apply with `patch -p0'):
20 *** ../bash-5.2-patched/parse.y Fri May 26 16:57:03 2023
21 --- parse.y Thu Jun 1 16:30:19 2023
22 ***************
23 *** 6854,6860 ****
25 WORD_LIST *wl, *rl;
26 ! int tok, orig_line_number, assignok;
27 sh_parser_state_t ps;
28 char *ret;
30 orig_line_number = line_number;
31 --- 6858,6865 ----
33 WORD_LIST *wl, *rl;
34 ! int tok, orig_line_number, assignok, ea, restore_pushed_strings;
35 sh_parser_state_t ps;
36 char *ret;
37 + STRING_SAVER *ss;
39 orig_line_number = line_number;
40 ***************
41 *** 6879,6882 ****
42 --- 6884,6893 ----
43 esacs_needed_count = expecting_in_token = 0;
45 + /* We're not pushing any new input here, we're reading from the current input
46 + source. If that's an alias, we have to be prepared for the alias to get
47 + popped out from underneath us. */
48 + ss = (ea = expanding_alias ()) ? pushed_string_list : (STRING_SAVER *)NULL;
49 + restore_pushed_strings = 0;
51 while ((tok = read_token (READ)) != ')')
53 ***************
54 *** 6902,6906 ****
55 --- 6913,6926 ----
58 + /* Check whether or not an alias got popped out from underneath us and
59 + fix up after restore_parser_state. */
60 + if (ea && ss && ss != pushed_string_list)
61 + {
62 + restore_pushed_strings = 1;
63 + ss = pushed_string_list;
64 + }
65 restore_parser_state (&ps);
66 + if (restore_pushed_strings)
67 + pushed_string_list = ss;
69 if (wl == &parse_string_error)
70 *** ../bash-5.2-patched/y.tab.c Mon Sep 23 10:02:46 2024
71 --- y.tab.c Mon Sep 23 10:02:49 2024
72 ***************
73 *** 8804,8812 ****
74 int *retlenp;
76 WORD_LIST *wl, *rl;
77 ! int tok, orig_line_number, assignok;
78 sh_parser_state_t ps;
79 char *ret;
81 orig_line_number = line_number;
82 save_parser_state (&ps);
83 --- 8804,8813 ----
84 int *retlenp;
86 WORD_LIST *wl, *rl;
87 ! int tok, orig_line_number, assignok, ea, restore_pushed_strings;
88 sh_parser_state_t ps;
89 char *ret;
90 + STRING_SAVER *ss;
92 orig_line_number = line_number;
93 save_parser_state (&ps);
94 ***************
95 *** 8829,8834 ****
96 --- 8830,8841 ----
98 esacs_needed_count = expecting_in_token = 0;
100 + /* We're not pushing any new input here, we're reading from the current input
101 + source. If that's an alias, we have to be prepared for the alias to get
102 + popped out from underneath us. */
103 + ss = (ea = expanding_alias ()) ? pushed_string_list : (STRING_SAVER *)NULL;
104 + restore_pushed_strings = 0;
106 while ((tok = read_token (READ)) != ')')
108 if (tok == '\n') /* Allow newlines in compound assignments */
109 ***************
110 *** 8852,8858 ****
111 --- 8859,8874 ----
112 wl = make_word_list (yylval.word, wl);
115 + /* Check whether or not an alias got popped out from underneath us and
116 + fix up after restore_parser_state. */
117 + if (ea && ss && ss != pushed_string_list)
119 + restore_pushed_strings = 1;
120 + ss = pushed_string_list;
122 restore_parser_state (&ps);
123 + if (restore_pushed_strings)
124 + pushed_string_list = ss;
126 if (wl == &parse_string_error)
129 *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
130 --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
131 ***************
132 *** 26,30 ****
133 looks for to find the patch level (for the sccs version string). */
135 ! #define PATCHLEVEL 33
137 #endif /* _PATCHLEVEL_H_ */
138 --- 26,30 ----
139 looks for to find the patch level (for the sccs version string). */
141 ! #define PATCHLEVEL 34
143 #endif /* _PATCHLEVEL_H_ */