diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/digest/digest.c | 4 | ||||
-rw-r--r-- | ext/objspace/depend | 3 | ||||
-rw-r--r-- | ext/objspace/objspace.c | 1 |
3 files changed, 6 insertions, 2 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c index 6f9149c31d..d535b35980 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -436,14 +436,14 @@ get_digest_base_metadata(VALUE klass) VALUE obj; rb_digest_metadata_t *algo; - for (p = klass; p; p = RCLASS_SUPER(p)) { + for (p = klass; !NIL_P(p); p = rb_class_superclass(p)) { if (rb_ivar_defined(p, id_metadata)) { obj = rb_ivar_get(p, id_metadata); break; } } - if (!p) + if (NIL_P(p)) rb_raise(rb_eRuntimeError, "Digest::Base cannot be directly inherited in Ruby"); Data_Get_Struct(obj, rb_digest_metadata_t, algo); diff --git a/ext/objspace/depend b/ext/objspace/depend new file mode 100644 index 0000000000..83a08f7078 --- /dev/null +++ b/ext/objspace/depend @@ -0,0 +1,3 @@ +objspace.o: $(hdrdir)/ruby/ruby.h $(hdrdir)/ruby/st.h $(hdrdir)/ruby/io.h \ + $(hdrdir)/ruby/re.h $(top_srcdir)/node.h $(top_srcdir)/gc.h \ + $(top_srcdir)/regint.h $(top_srcdir)/internal.h diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c index e61eda8ab9..8e8b29f6e9 100644 --- a/ext/objspace/objspace.c +++ b/ext/objspace/objspace.c @@ -30,6 +30,7 @@ #include "node.h" #include "gc.h" #include "regint.h" +#include "internal.h" size_t rb_str_memsize(VALUE); size_t rb_ary_memsize(VALUE); |