[macruby-changes] [4874] MacRuby/trunk/compiler.cpp

source_changes at macosforge.org source_changes at macosforge.org
Tue Nov 2 19:15:03 PDT 2010


Revision: 4874
          http://trac.macosforge.org/projects/ruby/changeset/4874
Author:   lsansonetti at apple.com
Date:     2010-11-02 19:15:01 -0700 (Tue, 02 Nov 2010)
Log Message:
-----------
fix a bug when binding var slots would be taken first before block dvars

Modified Paths:
--------------
    MacRuby/trunk/compiler.cpp

Modified: MacRuby/trunk/compiler.cpp
===================================================================
--- MacRuby/trunk/compiler.cpp	2010-11-02 23:46:13 UTC (rev 4873)
+++ MacRuby/trunk/compiler.cpp	2010-11-03 02:15:01 UTC (rev 4874)
@@ -6164,6 +6164,15 @@
 #endif
 	return iter->second;
     }
+    if (current_block) {
+	Value *slot = compile_dvar_slot(name);
+	if (slot != NULL) {	
+#if ROXOR_COMPILER_DEBUG
+	    printf("get_dvar %s\n", rb_id2name(name));
+#endif
+	    return slot;
+	}
+    }
     VALUE *var = GET_VM()->get_binding_lvar(name, false);
     if (var != NULL) {
 #if ROXOR_COMPILER_DEBUG
@@ -6175,13 +6184,8 @@
 	}
 	return new IntToPtrInst(int_val, RubyObjPtrTy, "", bb);
     }
-    assert(current_block);
-    Value *slot = compile_dvar_slot(name);
-    assert(slot != NULL);
-#if ROXOR_COMPILER_DEBUG
-    printf("get_dvar %s\n", rb_id2name(name));
-#endif
-    return slot;
+    fprintf(stderr, "can't find slot for variable %s\n", rb_id2name(name));
+    abort();
 }
 
 Value *
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101102/f23b3e0a/attachment-0001.html>


More information about the macruby-changes mailing list