error.c: preserve encoding

* error.c (rb_error_frozen_object): preserve encoding of class
  name in error message.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2014-09-19 01:46:42 +00:00
parent d9a597408f
commit 8b9afe6520
3 changed files with 20 additions and 1 deletions

View file

@ -255,13 +255,14 @@ PRINTF_ARGS(void rb_compile_error(const char*, int, const char*, ...), 3, 4);
PRINTF_ARGS(void rb_compile_error_with_enc(const char*, int, void *, const char*, ...), 4, 5);
PRINTF_ARGS(void rb_compile_error_append(const char*, ...), 1, 2);
NORETURN(void rb_error_frozen(const char*));
NORETURN(void rb_error_frozen_object(VALUE));
void rb_error_untrusted(VALUE);
void rb_check_frozen(VALUE);
void rb_check_trusted(VALUE);
#define rb_check_frozen_internal(obj) do { \
VALUE frozen_obj = (obj); \
if (OBJ_FROZEN(frozen_obj)) { \
rb_error_frozen(rb_obj_classname(frozen_obj)); \
rb_error_frozen_object(frozen_obj); \
} \
} while (0)
#define rb_check_trusted_internal(obj) ((void) 0)