[macruby-changes] [1589] MacRuby/branches/experimental
source_changes at macosforge.org
source_changes at macosforge.org
Fri May 22 13:58:31 PDT 2009
Revision: 1589
http://trac.macosforge.org/projects/ruby/changeset/1589
Author: lsansonetti at apple.com
Date: 2009-05-22 13:58:31 -0700 (Fri, 22 May 2009)
Log Message:
-----------
fix a few regressions
Modified Paths:
--------------
MacRuby/branches/experimental/main.cpp
MacRuby/branches/experimental/roxor.cpp
MacRuby/branches/experimental/roxor.h
MacRuby/branches/experimental/vm_method.c
Modified: MacRuby/branches/experimental/main.cpp
===================================================================
--- MacRuby/branches/experimental/main.cpp 2009-05-22 17:36:53 UTC (rev 1588)
+++ MacRuby/branches/experimental/main.cpp 2009-05-22 20:58:31 UTC (rev 1589)
@@ -26,7 +26,6 @@
ruby_sysinit(&argc, &argv);
ruby_init();
void *node = ruby_options(argc, argv);
- assert(node != NULL);
if (ruby_aot_compile) {
rb_vm_aot_compile((NODE *)node);
rb_exit(0);
Modified: MacRuby/branches/experimental/roxor.cpp
===================================================================
--- MacRuby/branches/experimental/roxor.cpp 2009-05-22 17:36:53 UTC (rev 1588)
+++ MacRuby/branches/experimental/roxor.cpp 2009-05-22 20:58:31 UTC (rev 1589)
@@ -3260,6 +3260,7 @@
}
else {
node = iter->second;
+ assert(node->objc_imp == imp);
}
node->arity = arity;
node->flags = flags;
@@ -4741,7 +4742,7 @@
case NODE_ALIAS:
{
if (aliasFunc == NULL) {
- // void rb_vm_alias(VALUE outer, ID from, ID to, unsigned char is_var);
+ // void rb_vm_alias(VALUE outer, ID from, ID to);
aliasFunc = cast<Function>(module->getOrInsertFunction("rb_vm_alias",
Type::VoidTy, RubyObjTy, IntTy, IntTy, NULL));
}
@@ -6809,7 +6810,7 @@
extern "C" void rb_print_undef(VALUE, ID, int);
static void
-rb_vm_alias_method(Class klass, Method method, ID name, int arity)
+rb_vm_alias_method(Class klass, Method method, ID name, bool noargs)
{
IMP imp = method_getImplementation(method);
const char *types = method_getTypeEncoding(method);
@@ -6822,7 +6823,7 @@
const char *name_str = rb_id2name(name);
SEL sel;
- if (arity == 0) {
+ if (noargs) {
sel = sel_registerName(name_str);
}
else {
@@ -6863,10 +6864,10 @@
rb_print_undef((VALUE)klass, def, 0);
}
if (def_method1 != NULL) {
- rb_vm_alias_method(klass, def_method1, name, 0);
+ rb_vm_alias_method(klass, def_method1, name, true);
}
if (def_method2 != NULL) {
- rb_vm_alias_method(klass, def_method2, name, 1);
+ rb_vm_alias_method(klass, def_method2, name, false);
}
}
@@ -7586,11 +7587,11 @@
extern "C"
void
-rb_vm_define_method2(Class klass, rb_vm_method_node_t *node, bool direct)
+rb_vm_define_method2(Class klass, SEL sel, rb_vm_method_node_t *node, bool direct)
{
assert(node != NULL);
- __rb_vm_define_method(klass, node->sel, node->objc_imp, node->arity,
+ __rb_vm_define_method(klass, sel, node->objc_imp, node->arity,
node->flags, direct);
}
Modified: MacRuby/branches/experimental/roxor.h
===================================================================
--- MacRuby/branches/experimental/roxor.h 2009-05-22 17:36:53 UTC (rev 1588)
+++ MacRuby/branches/experimental/roxor.h 2009-05-22 20:58:31 UTC (rev 1589)
@@ -84,7 +84,8 @@
rb_vm_method_node_t *rb_vm_get_method_node(IMP imp);
void rb_vm_define_method(Class klass, SEL sel, IMP imp, NODE *node,
bool direct);
-void rb_vm_define_method2(Class klass, rb_vm_method_node_t *node, bool direct);
+void rb_vm_define_method2(Class klass, SEL sel, rb_vm_method_node_t *node,
+ bool direct);
void rb_vm_define_attr(Class klass, const char *name, bool read, bool write,
int noex);
void rb_vm_alias(VALUE klass, ID name, ID def);
Modified: MacRuby/branches/experimental/vm_method.c
===================================================================
--- MacRuby/branches/experimental/vm_method.c 2009-05-22 17:36:53 UTC (rev 1588)
+++ MacRuby/branches/experimental/vm_method.c 2009-05-22 20:58:31 UTC (rev 1589)
@@ -789,7 +789,7 @@
rb_bug("undefined method `%s'; can't happen", rb_id2name(id));
}
- rb_vm_define_method2(*(Class *)module, node, false);
+ rb_vm_define_method2(*(Class *)module, sel, node, false);
}
return module;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090522/604560c2/attachment.html>
More information about the macruby-changes
mailing list