summaryrefslogtreecommitdiff
path: root/include/ruby/internal/intern/error.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ruby/internal/intern/error.h')
-rw-r--r--include/ruby/internal/intern/error.h34
1 files changed, 12 insertions, 22 deletions
diff --git a/include/ruby/internal/intern/error.h b/include/ruby/internal/intern/error.h
index 37d3b8592b..1fd9ec2f51 100644
--- a/include/ruby/internal/intern/error.h
+++ b/include/ruby/internal/intern/error.h
@@ -38,8 +38,6 @@
#define rb_exc_new3 rb_exc_new_str /**< @old{rb_exc_new_str} */
/** @cond INTERNAL_MACRO */
-#define rb_check_trusted rb_check_trusted
-#define rb_check_trusted_inline rb_check_trusted
#define rb_check_arity rb_check_arity
/** @endcond */
@@ -204,12 +202,6 @@ RBIMPL_ATTR_NORETURN()
void rb_error_frozen_object(VALUE what);
/**
- * @deprecated Does nothing. This method is deprecated and will be removed in
- * Ruby 3.2.
- */
-void rb_error_untrusted(VALUE);
-
-/**
* Queries if the passed object is frozen.
*
* @param[in] obj Target object to test frozen-ness.
@@ -219,12 +211,6 @@ void rb_error_untrusted(VALUE);
void rb_check_frozen(VALUE obj);
/**
- * @deprecated Does nothing. This method is deprecated and will be removed in
- * Ruby 3.2.
- */
-void rb_check_trusted(VALUE);
-
-/**
* Ensures that the passed object can be `initialize_copy` relationship. When
* you implement your own one you would better call this at the right beginning
* of your implementation.
@@ -249,7 +235,9 @@ RBIMPL_ATTR_NORETURN()
* @param[in] max Maximum allowed `argc`.
* @exception rb_eArgError Always.
*/
-MJIT_STATIC void rb_error_arity(int argc, int min, int max);
+void rb_error_arity(int argc, int min, int max);
+
+void rb_str_modify(VALUE str);
RBIMPL_SYMBOL_EXPORT_END()
@@ -258,12 +246,7 @@ RBIMPL_SYMBOL_EXPORT_END()
*
* Does anyone use this? Remain not deleted for compatibility.
*/
-#define rb_check_frozen_internal(obj) do { \
- VALUE frozen_obj = (obj); \
- if (RB_UNLIKELY(RB_OBJ_FROZEN(frozen_obj))) { \
- rb_error_frozen_object(frozen_obj); \
- } \
- } while (0)
+#define rb_check_frozen_internal rb_check_frozen
/** @alias{rb_check_frozen} */
static inline void
@@ -272,9 +255,16 @@ rb_check_frozen_inline(VALUE obj)
if (RB_UNLIKELY(RB_OBJ_FROZEN(obj))) {
rb_error_frozen_object(obj);
}
+
+ /* ref: internal CHILLED_STRING_P()
+ This is an implementation detail subject to change. */
+ if (RB_UNLIKELY(RB_TYPE_P(obj, T_STRING) && FL_TEST_RAW(obj, RUBY_FL_USER2 | RUBY_FL_USER3))) { // STR_CHILLED
+ rb_str_modify(obj);
+ }
}
-/** @alias{rb_check_frozen} */
+/* rb_check_frozen() is available as a symbol, but have
+ * the inline version take priority for native consumers. */
#define rb_check_frozen rb_check_frozen_inline
/**