[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

[MD:1465]A solution for "Bitmap kills emacs" problem.



蚤の市にいってきたけど...あんまり良いものなかったな。
かえって疲れちゃったかも。

Miyashita Hisashi(宮下 尚:HIMI) <himi@xxxxxxxxxxxxxxxxxxxxxxxxx> writes:

> ふう、やっとバグを取り終えた。テストバイナリもしばらく後におきます。
> これは、前のswitch-frameの修正も含みます。

ftp://ftp.m17n.org/pub/mule/Windows/beta

に、temacs-990919.exe.gzを置きました。
ミラー完了まで待ってくださいね。

なんかコメントとChangeLogが気に入らなかったので、
ちょっと修正しました。^^;;; > 半田さん

# 明日からまたやたらと忙しいし。;_; 
# 映画見にいった方が良かったかな...

from himi

1999-09-19  Miyashita Hisashi  <himi@xxxxxxxxxxxxxxxxxxxxxxxxx>

	* charset.c (str_cmpchar_id): 
	Before xmalloc(), copy str to buf where is safe against
	memory realocation caused by r_alloc.  After cmpcharp->data is
	prepared by xmalloc(), copy buf to here.

*** charset.c.orig	Sun Sep 19 17:18:03 1999
--- charset.c	Sun Sep 19 17:21:22 1999
***************
*** 1557,1562 ****
--- 1557,1569 ----
    if (!registerp)
      return -1;
  
+   /* First we must copy str data to safe area against memory
+      reallocation because str would be made invalid by succeeding
+      xmalloc()s when str points r_alloced memory, which is usually
+      buffer memory.  From now on, we must not trust str. */
+   buf = (unsigned char*) alloca(sizeof(unsigned char) * len);
+   bcopy (str, buf, len);
+ 
    /* We have to register the composite character in cmpchar_table.  */
    if (n_cmpchars >= (CHAR_FIELD2_MASK | CHAR_FIELD3_MASK))
      /* No, we have no more room for a new composite character.  */
***************
*** 1603,1609 ****
  
    cmpcharp->len = len;
    cmpcharp->data = (unsigned char *) xmalloc (len + 1);
!   bcopy (str, cmpcharp->data, len);
    cmpcharp->data[len] = 0;
    cmpcharp->glyph_len = chars;
    cmpcharp->glyph = (GLYPH *) xmalloc (sizeof (GLYPH) * chars);
--- 1610,1616 ----
  
    cmpcharp->len = len;
    cmpcharp->data = (unsigned char *) xmalloc (len + 1);
!   bcopy (buf, cmpcharp->data, len);
    cmpcharp->data[len] = 0;
    cmpcharp->glyph_len = chars;
    cmpcharp->glyph = (GLYPH *) xmalloc (sizeof (GLYPH) * chars);