[#444] io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...>

I am encountering a problem similar to the one mentioned here,

19 messages 2002/09/06
[#453] Re: io_write()/fwrite() and EINTR on Solaris — nobu.nokada@... 2002/09/08

Hi,

[#454] Re: io_write()/fwrite() and EINTR on Solaris — matz@... (Yukihiro Matsumoto) 2002/09/09

Hi

[#469] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/09

On Mon, Sep 09, 2002 at 03:55:13PM +0900, Yukihiro Matsumoto wrote:

[#479] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/10

On Tue, Sep 10, 2002 at 01:04:10AM +0900, Jos Backus wrote:

[#492] Re: io_write()/fwrite() and EINTR on Solaris — Jos Backus <jos@...> 2002/09/21

On Wed, Sep 11, 2002 at 02:23:33AM +0900, Jos Backus wrote:

[Fix, NO alloca] Parse.y

From: Michal Rokos <m.rokos@...>
Date: 2002-09-09 09:11:55 UTC
List: ruby-core #459
Hi,

	there are some places where we don't need to use alloca.

	This is one of these.

	Please note the fix in 2nd chunk (missing 'id = ').

		Michal

--- ../ruby-09-06/parse.y	Fri Sep  6 20:55:37 2002
+++ parse.y	Sat Sep  7 20:07:05 2002
@@ -5504,11 +5504,12 @@
 	last = strlen(name)-1;
 	if (name[last] == '=') {
 	    /* attribute assignment */
-	    char *buf = ALLOCA_N(char,last+1);
+	    char *buf = ALLOC_N(char,last+1);
 
 	    strncpy(buf, name, last);
 	    buf[last] = '\0';
 	    id = rb_intern(buf);
+	    free(buf);
 	    if (id > LAST_TOKEN && !is_attrset_id(id)) {
 		id = rb_id_attrset(id);
 		goto id_regist;
@@ -5559,11 +5560,12 @@
       again:
 	name = rb_id2name(id2);
 	if (name) {
-	    char *buf = ALLOCA_N(char, strlen(name)+2);
+	    char *buf = ALLOC_N(char, strlen(name)+2);
 
 	    strcpy(buf, name);
 	    strcat(buf, "=");
-	    rb_intern(buf);
+	    id = rb_intern(buf);
+	    free(buf);
 	    return rb_id2name(id);
 	}
 	if (is_local_id(id2)) {

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos@sh.cvut.cz      ICQ:36118339      Jabber:majkl@jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In This Thread

Prev Next