diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 05:41:47 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-25 05:41:47 +0000 |
commit | 1f2d804e5e2b724e91e627faa53d1283cfe7554e (patch) | |
tree | 3a97f9cdb8e5933c11c955a6e655c906532a7453 | |
parent | c4b30b4449b0f8c843871a6468eaa416335c7024 (diff) | |
download | ruby-1f2d804e5e2b724e91e627faa53d1283cfe7554e.tar.gz |
* vm_insnhelper.c (vm_method_search): fix control flow bug.
(commited at r20981)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | vm_insnhelper.c | 14 |
2 files changed, 11 insertions, 8 deletions
@@ -1,3 +1,8 @@ +Thu Dec 25 14:32:23 2008 Koichi Sasada <ko1@atdot.net> + + * vm_insnhelper.c (vm_method_search): fix control flow bug. + (commited at r20981) + Thu Dec 25 13:28:20 2008 NAKAMURA Usaku <usa@ruby-lang.org> * io.c (rb_io_flush): fsync() after buffer is flushed on win32. diff --git a/vm_insnhelper.c b/vm_insnhelper.c index b1fa088186..28eaeb7951 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1172,24 +1172,22 @@ vm_method_search(VALUE id, VALUE klass, IC ic) static inline VALUE vm_search_normal_superclass(VALUE klass, VALUE recv) { - VALUE sk = 0; - if (BUILTIN_TYPE(klass) == T_CLASS) { - sk = RCLASS_SUPER(klass); + return RCLASS_SUPER(klass); } else if (BUILTIN_TYPE(klass) == T_MODULE) { VALUE k = CLASS_OF(recv); while (k) { if (BUILTIN_TYPE(k) == T_ICLASS && RBASIC(k)->klass == klass) { - sk = RCLASS_SUPER(k); - break; + return RCLASS_SUPER(k); } k = RCLASS_SUPER(k); } - sk = rb_cObject; + return rb_cObject; + } + else { + rb_bug("vm_search_normal_superclass: should not be reach here"); } - - return sk; } static void |