emacs-devel
[Top][All Lists]
Advanced

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

(set-match-data '(1 2 3)) crashes Emacs


From: Kenichi Handa
Subject: (set-match-data '(1 2 3)) crashes Emacs
Date: Mon, 30 Oct 2000 13:21:59 +0900 (JST)

Emacs crashes by (set-match-data '(1 2 3)) because the code
in Fset_match_data leaves search_regs in insane status when
CHECK_NUMBER_COERCE_MARKER is called.

I've just installed the attaced change to fix it.  I assumed
that if search_regs.start[i] is -1, we don't have to pay
attention to search_regs.end[i].  Correct?

---
Ken'ichi HANDA
address@hidden

2000-10-30  Kenichi Handa  <address@hidden>

        * search.c (Fset_match_data): Be sure to make search_regs always
        sane.

*** search.c.~1.148.~   Mon Oct 30 11:46:15 2000
--- search.c    Mon Oct 30 13:05:46 2000
***************
*** 2746,2751 ****
--- 2746,2754 ----
                                       length * sizeof (regoff_t));
          }
  
+       for (i = search_regs.num_regs; i < length; i++)
+         search_regs.start[i] = -1;
+ 
        search_regs.num_regs = length;
        }
    }
***************
*** 2760,2765 ****
--- 2763,2770 ----
        }
        else
        {
+         int from;
+ 
          if (MARKERP (marker))
            {
              if (XMARKER (marker)->buffer == 0)
***************
*** 2769,2775 ****
            }
  
          CHECK_NUMBER_COERCE_MARKER (marker, 0);
!         search_regs.start[i] = XINT (marker);
          list = Fcdr (list);
  
          marker = Fcar (list);
--- 2774,2780 ----
            }
  
          CHECK_NUMBER_COERCE_MARKER (marker, 0);
!         from = XINT (marker);
          list = Fcdr (list);
  
          marker = Fcar (list);
***************
*** 2777,2782 ****
--- 2782,2788 ----
            XSETFASTINT (marker, 0);
  
          CHECK_NUMBER_COERCE_MARKER (marker, 0);
+         search_regs.start[i] = from;
          search_regs.end[i] = XINT (marker);
        }
        list = Fcdr (list);



reply via email to

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