Skip to content
Browse files

#instance_eval: don't attempt to create singleton classes on symbols

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRuby/trunk@4407 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent 32f8948 commit a834a3e62cbf5ba16b443d40fd4fcfdb44908459 Laurent Sansonetti committed
Showing with 7 additions and 10 deletions.
  1. +7 −10 vm_eval.c
View
17 vm_eval.c
@@ -521,19 +521,16 @@ rb_obj_instance_eval(VALUE self, SEL sel, VALUE top, int argc, VALUE *argv)
{
VALUE klass;
- if (SPECIAL_CONST_P(self)) {
+ if (SPECIAL_CONST_P(self) || CLASS_OF(self) == rb_cSymbol) {
klass = 0;
}
else {
- switch (TYPE(self)) {
- default:
- klass = rb_singleton_class(self);
- switch (TYPE(top)) {
- case T_CLASS:
- case T_MODULE:
- rb_vm_set_outer(klass, top);
- break;
- }
+ klass = rb_singleton_class(self);
+ switch (TYPE(top)) {
+ case T_CLASS:
+ case T_MODULE:
+ rb_vm_set_outer(klass, top);
+ break;
}
}
return specific_eval(argc, argv, klass, self);

0 comments on commit a834a3e

Please sign in to comment.
Something went wrong with that request. Please try again.