From: Michal Rokos Date: 2002-09-13T20:25:18+09:00 Subject: Re: [Fix, NO alloca] Parse.y Hello, I'm just wondering if somebody looked at the patch I sent. (I don't think the ALLOCA->ALLOC part, but the pard in 2nd chunk about (id =)... Michal On Mon, Sep 09, 2002 at 06:11:55PM +0900, Michal Rokos wrote: > 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); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (here it is) > + 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 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-