[前][次][番号順一覧][スレッド一覧]

ruby-changes:18642

From: kosaki <ko1@a...>
Date: Thu, 27 Jan 2011 18:21:49 +0900 (JST)
Subject: [ruby-changes:18642] Ruby:r30666 (trunk): * win32/win32.c (wstati64): get rid of too huge alloca().

kosaki	2011-01-27 18:21:40 +0900 (Thu, 27 Jan 2011)

  New Revision: 30666

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30666

  Log:
    * win32/win32.c (wstati64): get rid of too huge alloca().
      [Bug #4316] [ruby-core:34834]

  Modified files:
    trunk/ChangeLog
    trunk/win32/win32.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30665)
+++ ChangeLog	(revision 30666)
@@ -1,3 +1,8 @@
+Thu Jan 27 18:19:51 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* win32/win32.c (wstati64): get rid of too huge alloca().
+	  [Bug #4316] [ruby-core:34834]
+
 Thu Jan 27 15:11:52 2011  NAKAMURA Usaku  <usa@r...>
 
 	* win32/win32.c (rb_w32_spawn, rb_w32_aspawn): get rid of too huge
Index: win32/win32.c
===================================================================
--- win32/win32.c	(revision 30665)
+++ win32/win32.c	(revision 30666)
@@ -4181,13 +4181,14 @@
     WCHAR *buf1, *s, *end;
     int len, size;
     int ret;
+    VALUE v;
 
     if (!path || !st) {
 	errno = EFAULT;
 	return -1;
     }
     size = lstrlenW(path) + 2;
-    buf1 = ALLOCA_N(WCHAR, size);
+    buf1 = ALLOCV_N(WCHAR, v, size);
     for (p = path, s = buf1; *p; p++, s++) {
 	if (*p == L'/')
 	    *s = L'\\';
@@ -4215,6 +4216,9 @@
     if (ret == 0) {
 	st->st_mode &= ~(S_IWGRP | S_IWOTH);
     }
+    if (v)
+	ALLOCV_END(v);
+
     return ret;
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]