Subject: bug#15344: 24.3; Crash when yanking in c-mode

From: Daniel Colascione <[email-masked]>
Date: Mon, 13 Jan 2014 06:11:29 -0800

On 01/13/2014 05:59 AM, Daniel Colascione wrote:
> On 01/13/2014 05:39 AM, Thien-Thi Nguyen wrote:
>> Here is a script to make debugging easier:
>
> Thanks. Does this patch have any unwanted side effects? It seems
> perfectly reasonable to me that we could reach the end of the interval
> tree without finding anything to modify or going past our bound.
>
> === modified file 'src/textprop.c'

Actually, you probably want this one.

=== modified file 'src/textprop.c'
--- src/textprop.c	2014-01-01 07:43:34 +0000
+++ src/textprop.c	2014-01-13 14:07:21 +0000
@@ -1741,6 +1741,17 @@
  	}
        len -= LENGTH (i);
        i = next_interval (i);
+      if(!i)
+        if (modified)
+          {
+            if (BUFFERP (object))
+              signal_after_change (XINT (start),
+                                   XINT (end) - XINT (start),
+                                   XINT (end) - XINT (start));
+            return Qt;
+          }
+        else
+          return Qnil;
      }
  }