bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash-2.05 patch 5


From: Chet Ramey
Subject: bash-2.05 patch 5
Date: Thu, 3 May 2001 17:16:54 -0400

                             BASH PATCH REPORT
                             =================

Bash-Release: 2.05
Patch-ID: bash205-005

Bug-Reported-by: Paul Eggert <eggert@twinsun.com>
Bug-Reference-ID: <200105030205.TAA01056@shade.twinsun.com>

Bug-Description:

(from Paul's report)

        Bash 2.05 fails the "make check" on 64-bit Solaris 7 (sparc);
        it reports bogus line numbers and eventually goes into an
        infinite loop.

        The problem is that Bash uses one method (a union) to convert
        an integer to a char * in unwind_protect_int, and a different
        method (a cast) to convert back in restore_variable.  These
        two methods are equivalent when sizeof (int) == sizeof (char *),
        and they are also equivalent on little-endian platform like an
        Alpha even when sizeof (int) < sizeof (char *); but they are
        not equivalent when you are using a big-endian platform where
        sizeof (int) < sizeof (char *).


Patch:
*** ../bash-2.05/unwind_prot.c  Wed Feb 14 17:00:55 2001
--- unwind_prot.c       Thu May  3 16:38:27 2001
***************
*** 214,218 ****
  {
    int free_elts = (int)flag;
-   UNWIND_ELT *elt;
  
    if (free_elts != 0 && unwind_protect_list)
--- 214,217 ----
***************
*** 294,297 ****
--- 293,298 ----
       SAVED_VAR *sv;
  {
+   UWP u;
+ 
    if (sv->size != sizeof (int))
      {
***************
*** 300,304 ****
      }
    else
!     *(sv->variable) = (int)sv->desired_setting;
  
    free (sv);
--- 301,308 ----
      }
    else
!     {
!       u.s = sv->desired_setting;
!       *(sv->variable) = u.i;
!     }
  
    free (sv);

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]