[MacRuby-devel] Segmentation fault for classes with multiple modules chained with super
Alexey Borzenkov
snaury at gmail.com
Tue Sep 1 11:58:26 PDT 2009
On Tue, Sep 1, 2009 at 1:12 AM, Laurent Sansonetti<lsansonetti at apple.com> wrote:
> Hi Alexey,
>
> Looks like you found a bug in super :) Would you be willing to contribute a
> snippet for test_vm/dispatch.rb? This is where we keep all these weird cases
> to make sure we won't forget to fix them.
Here it is. Works on both MRI 1.8 and 1.9:
diff --git a/test_vm/dispatch.rb b/test_vm/dispatch.rb
index 052f5f5..dee4376 100644
--- a/test_vm/dispatch.rb
+++ b/test_vm/dispatch.rb
@@ -371,3 +371,11 @@ assert "42", %{
class Y < X; def foo(x); 1.times { |; x| x = 1; super; } end; end
Y.new.foo(42)
}
+
+assert "true", %{
+ class X; def foo(x); x; end; end
+ module M1; def foo(x); super(true); end; end
+ module M2; def foo(x); return false if x; super; end; end
+ class Y < X; include M1; include M2; def foo; super(false); end; end
+ p Y.new.foo
+}
More information about the MacRuby-devel
mailing list