bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13743: 24.2.93; Segmentation fault when trying to [s]teal a file ope


From: Stefan Monnier
Subject: bug#13743: 24.2.93; Segmentation fault when trying to [s]teal a file opened elsewhere
Date: Sat, 23 Feb 2013 11:59:18 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> I can fix this particular problem with this simple patch:
[...]
> However, I'm not sure this is the right or the best way.  If it is, it
> will probably be prudent to add some protection against infinite
> recursion here.

How 'bout moving the

   if (BUFFERP (object))
     modify_region (object, start, end);

earlier in the function.  Something like the patch below.


        Stefan


=== modified file 'src/textprop.c'
--- src/textprop.c      2013-01-02 16:13:04 +0000
+++ src/textprop.c      2013-02-23 16:58:50 +0000
@@ -60,7 +60,7 @@
 static Lisp_Object Qread_only;
 Lisp_Object Qminibuffer_prompt;
 
-/* Sticky properties */
+/* Sticky properties.  */
 Lisp_Object Qfront_sticky, Qrear_nonsticky;
 
 /* If o1 is a cons whose cdr is a cons, return non-zero and set o2 to
@@ -1145,9 +1145,16 @@
   if (!i)
     return Qnil;
 
+  if (BUFFERP (object))
+    modify_region (object, start, end);
+
   s = XINT (start);
   len = XINT (end) - s;
 
+  /* Recompute `i' since modify_region may have performed indirectly
+     arbitrary modifications to the interval tree.  */
+  i = interval_of (s, object);
+
   /* No need to protect OBJECT, because we GC only if it's a buffer,
      and live buffers are always protected.  */
   GCPRO1 (properties);
@@ -1174,9 +1181,6 @@
        }
     }
 
-  if (BUFFERP (object))
-    modify_region (object, start, end);
-
   /* We are at the beginning of interval I, with LEN chars to scan.  */
   for (;;)
     {






reply via email to

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