[macruby-changes] [835] MacRuby/trunk/compile.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 2 23:39:10 PST 2009


Revision: 835
          http://trac.macosforge.org/projects/ruby/changeset/835
Author:   lsansonetti at apple.com
Date:     2009-03-02 23:39:10 -0800 (Mon, 02 Mar 2009)
Log Message:
-----------
fixed a bug when attribute assignments as part of the left operand of a multiple assignment wouldn't be compiled with the right selector name

Modified Paths:
--------------
    MacRuby/trunk/compile.c

Modified: MacRuby/trunk/compile.c
===================================================================
--- MacRuby/trunk/compile.c	2009-03-03 07:38:30 UTC (rev 834)
+++ MacRuby/trunk/compile.c	2009-03-03 07:39:10 UTC (rev 835)
@@ -699,14 +699,13 @@
     mcache->flags = RB_MCACHE_RCALL_FLAG;
     mcache->as.rcall.klass = 0;
     mcache->as.rcall.node = NULL;
-    if (FIX2INT(argc) > 0) {
-	char *id_str;
-	size_t id_str_len;
-	char buf[100];
 
-	id_str = (char *)rb_sym2name(id);
-	id_str_len = strlen(id_str);
+    char *id_str = (char *)rb_sym2name(id);
+    size_t id_str_len = strlen(id_str);
 
+    if (FIX2INT(argc) > 0 || id_str[id_str_len - 1] == '=') {
+	char buf[100];
+
 	if (id_str[id_str_len - 1] != ':') {
 	    snprintf(buf, sizeof buf, "%s:", id_str);
 	    id_str = buf;
@@ -715,11 +714,11 @@
 	mcache->as.rcall.sel = sel_registerName(id_str);
     }
     else {
-	mcache->as.rcall.sel = sel_registerName(rb_sym2name(id));
+	mcache->as.rcall.sel = sel_registerName(id_str);
 	if (mcache->as.rcall.sel == sel_ignored
 	    || mcache->as.rcall.sel == sel_zone) {
 	    char buf[100];
-	    snprintf(buf, sizeof buf, "__rb_%s__", rb_sym2name(id));
+	    snprintf(buf, sizeof buf, "__rb_%s__", id_str);
 	    mcache->as.rcall.sel = sel_registerName(buf);
 	}
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090302/2c563997/attachment.html>


More information about the macruby-changes mailing list