bash52-029.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 5.2
  4. Patch-ID: bash52-029
  5. Bug-Reported-by: Grisha Levit <grishalevit@gmail.com>
  6. Bug-Reference-ID: <CAMu=Brp9QHvLh8vbY45hRgCVaQUNSnU7n8EVjsWKajT7c99K8Q@mail.gmail.com>
  7. Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2023-04/msg00072.html
  8. Bug-Description:
  9. There are problems with recovery after parser errors when parsing compound
  10. assignments. For instance, the `local' builtin reports an error but never
  11. cleans up the function context.
  12. Patch (apply with `patch -p0'):
  13. *** ../bash-20230427/parse.y Fri Apr 14 11:50:29 2023
  14. --- parse.y Mon May 1 16:25:14 2023
  15. ***************
  16. *** 6471,6478 ****
  17. {
  18. set_exit_status (EXECUTION_FAILURE);
  19. if (interactive_shell == 0 && posixly_correct)
  20. jump_to_top_level (FORCE_EOF);
  21. else
  22. ! jump_to_top_level (DISCARD);
  23. }
  24. --- 6471,6483 ----
  25. {
  26. set_exit_status (EXECUTION_FAILURE);
  27. + current_token = '\n'; /* XXX */
  28. if (interactive_shell == 0 && posixly_correct)
  29. jump_to_top_level (FORCE_EOF);
  30. else
  31. ! {
  32. ! if (executing && parse_and_execute_level == 0)
  33. ! top_level_cleanup ();
  34. ! jump_to_top_level (DISCARD);
  35. ! }
  36. }
  37. ***************
  38. *** 6538,6546 ****
  39. {
  40. set_exit_status (EXECUTION_FAILURE);
  41. ! last_read_token = '\n'; /* XXX */
  42. if (interactive_shell == 0 && posixly_correct)
  43. jump_to_top_level (FORCE_EOF);
  44. else
  45. ! jump_to_top_level (DISCARD);
  46. }
  47. --- 6543,6555 ----
  48. {
  49. set_exit_status (EXECUTION_FAILURE);
  50. ! last_read_token = current_token = '\n'; /* XXX */
  51. if (interactive_shell == 0 && posixly_correct)
  52. jump_to_top_level (FORCE_EOF);
  53. else
  54. ! {
  55. ! if (executing && parse_and_execute_level == 0)
  56. ! top_level_cleanup ();
  57. ! jump_to_top_level (DISCARD);
  58. ! }
  59. }
  60. *** ../bash-20230427/y.tab.c Tue Jul 30 15:19:31 2024
  61. --- y.tab.c Tue Jul 30 15:20:21 2024
  62. ***************
  63. *** 8786,8793 ****
  64. {
  65. set_exit_status (EXECUTION_FAILURE);
  66. if (interactive_shell == 0 && posixly_correct)
  67. jump_to_top_level (FORCE_EOF);
  68. else
  69. ! jump_to_top_level (DISCARD);
  70. }
  71. --- 8786,8798 ----
  72. {
  73. set_exit_status (EXECUTION_FAILURE);
  74. + current_token = '\n'; /* XXX */
  75. if (interactive_shell == 0 && posixly_correct)
  76. jump_to_top_level (FORCE_EOF);
  77. else
  78. ! {
  79. ! if (executing && parse_and_execute_level == 0)
  80. ! top_level_cleanup ();
  81. ! jump_to_top_level (DISCARD);
  82. ! }
  83. }
  84. ***************
  85. *** 8853,8861 ****
  86. {
  87. set_exit_status (EXECUTION_FAILURE);
  88. ! last_read_token = '\n'; /* XXX */
  89. if (interactive_shell == 0 && posixly_correct)
  90. jump_to_top_level (FORCE_EOF);
  91. else
  92. ! jump_to_top_level (DISCARD);
  93. }
  94. --- 8858,8870 ----
  95. {
  96. set_exit_status (EXECUTION_FAILURE);
  97. ! last_read_token = current_token = '\n'; /* XXX */
  98. if (interactive_shell == 0 && posixly_correct)
  99. jump_to_top_level (FORCE_EOF);
  100. else
  101. ! {
  102. ! if (executing && parse_and_execute_level == 0)
  103. ! top_level_cleanup ();
  104. ! jump_to_top_level (DISCARD);
  105. ! }
  106. }
  107. *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
  108. --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
  109. ***************
  110. *** 26,30 ****
  111. looks for to find the patch level (for the sccs version string). */
  112. ! #define PATCHLEVEL 28
  113. #endif /* _PATCHLEVEL_H_ */
  114. --- 26,30 ----
  115. looks for to find the patch level (for the sccs version string). */
  116. ! #define PATCHLEVEL 29
  117. #endif /* _PATCHLEVEL_H_ */