Index: src/org/jruby/RubyObject.java
===================================================================
RCS file: /cvsroot/jruby/jruby/src/org/jruby/RubyObject.java,v
retrieving revision 1.92
diff -b -u -r1.92 RubyObject.java
--- src/org/jruby/RubyObject.java	22 Jun 2006 02:11:16 -0000	1.92
+++ src/org/jruby/RubyObject.java	3 Jul 2006 04:09:11 -0000
@@ -653,9 +653,6 @@
             }
             IRubyObject newSelf = null;
             if (scope.isNil() || !(scope instanceof RubyBinding)) {
-                threadContext.pushRubyClass(this instanceof RubyModule ? 
-                        (RubyModule) this : this.getType());
-
                 if (threadContext.getPreviousFrame() != null) {
                     threadContext.getCurrentFrame().setIter(threadContext.getPreviousFrame().getIter());
                 }
@@ -681,7 +678,6 @@
             if (scope.isNil() || !(scope instanceof RubyBinding)) {
 //              FIXME: this is broken for Proc, see above
                 threadContext.getCurrentFrame().setIter(iter);
-                threadContext.popRubyClass();
             } else if (scope instanceof RubyBinding) {
                 threadContext.postEvalWithBinding();
             }
Index: test/testSpecialization.rb
===================================================================
RCS file: test/testSpecialization.rb
diff -N test/testSpecialization.rb
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ test/testSpecialization.rb	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,26 @@
+require 'test/minirunit'
+
+class Foo
+  def initialize(p)
+    @prefix = p
+  end
+
+  def result(val)
+    redefine_result
+    result val
+  end
+  
+  def redefine_result
+    method_decl = "def result(val); \"#{@prefix}: \#\{val\}\"; end"
+    instance_eval method_decl, "generated code (#{__FILE__}:#{__LINE__})"
+  end
+end
+
+f = Foo.new("foo")
+test_equal "foo: hi", f.result("hi")
+
+g = Foo.new("bar")
+test_equal "bar: hi", g.result("hi")
+
+test_equal "foo: bye", f.result("bye")
+test_equal "bar: bye", g.result("bye")
