aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2000-10-30 04:10:22 +0000
committerKenichi Handa2000-10-30 04:10:22 +0000
commite62371e929af0d1d53afeebfbfbb7dfb71739da8 (patch)
treef342dadedd423ded50ddd8f24dad1ef4752a12f9 /src
parent804060708913189affb90615ea5111b59cb4a63c (diff)
downloademacs-e62371e929af0d1d53afeebfbfbb7dfb71739da8.tar.gz
emacs-e62371e929af0d1d53afeebfbfbb7dfb71739da8.zip
(Fset_match_data): Be sure to make search_regs always sane.
Diffstat (limited to 'src')
-rw-r--r--src/search.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/search.c b/src/search.c
index ceeaef810e6..27b9b8181ca 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2746,6 +2746,9 @@ LIST should have been created by calling `match-data' previously.")
2746 length * sizeof (regoff_t)); 2746 length * sizeof (regoff_t));
2747 } 2747 }
2748 2748
2749 for (i = search_regs.num_regs; i < length; i++)
2750 search_regs.start[i] = -1;
2751
2749 search_regs.num_regs = length; 2752 search_regs.num_regs = length;
2750 } 2753 }
2751 } 2754 }
@@ -2760,6 +2763,8 @@ LIST should have been created by calling `match-data' previously.")
2760 } 2763 }
2761 else 2764 else
2762 { 2765 {
2766 int from;
2767
2763 if (MARKERP (marker)) 2768 if (MARKERP (marker))
2764 { 2769 {
2765 if (XMARKER (marker)->buffer == 0) 2770 if (XMARKER (marker)->buffer == 0)
@@ -2769,7 +2774,7 @@ LIST should have been created by calling `match-data' previously.")
2769 } 2774 }
2770 2775
2771 CHECK_NUMBER_COERCE_MARKER (marker, 0); 2776 CHECK_NUMBER_COERCE_MARKER (marker, 0);
2772 search_regs.start[i] = XINT (marker); 2777 from = XINT (marker);
2773 list = Fcdr (list); 2778 list = Fcdr (list);
2774 2779
2775 marker = Fcar (list); 2780 marker = Fcar (list);
@@ -2777,6 +2782,7 @@ LIST should have been created by calling `match-data' previously.")
2777 XSETFASTINT (marker, 0); 2782 XSETFASTINT (marker, 0);
2778 2783
2779 CHECK_NUMBER_COERCE_MARKER (marker, 0); 2784 CHECK_NUMBER_COERCE_MARKER (marker, 0);
2785 search_regs.start[i] = from;
2780 search_regs.end[i] = XINT (marker); 2786 search_regs.end[i] = XINT (marker);
2781 } 2787 }
2782 list = Fcdr (list); 2788 list = Fcdr (list);