summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rational.c b/rational.c
index 8d0e8306f5..c4469c8092 100644
--- a/rational.c
+++ b/rational.c
@@ -1605,6 +1605,10 @@ static VALUE
nurat_marshal_load(VALUE self, VALUE a)
{
get_dat1(self);
+
+ rb_check_frozen(self);
+ rb_check_trusted(self);
+
Check_Type(a, T_ARRAY);
if (RARRAY_LEN(a) != 2)
rb_raise(rb_eArgError, "marshaled rational must have an array whose length is 2 but %ld", RARRAY_LEN(a));