diff options
Diffstat (limited to 'error.c')
-rw-r--r-- | error.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -2011,6 +2011,21 @@ rb_check_trusted(VALUE obj) } void +rb_check_copyable(VALUE obj, VALUE orig) +{ + if (!FL_ABLE(obj)) return; + rb_check_frozen_internal(obj); + rb_check_trusted_internal(obj); + if (!FL_ABLE(orig)) return; + if ((~RBASIC(obj)->flags & RBASIC(orig)->flags) & (FL_UNTRUSTED|FL_TAINT)) { + if (rb_safe_level() > 0) { + rb_raise(rb_eSecurityError, "Insecure: can't modify %"PRIsVALUE, + RBASIC(obj)->klass); + } + } +} + +void Init_syserr(void) { rb_eNOERROR = set_syserr(0, "NOERROR"); |