summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index 34e8736a74..3e0ada4f1a 100644
--- a/io.c
+++ b/io.c
@@ -4173,8 +4173,7 @@ rb_io_each_codepoint(VALUE io)
rb_yield(UINT2NUM(c));
}
else if (MBCLEN_INVALID_P(r)) {
- invalid:
- rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
+ goto invalid;
}
else if (MBCLEN_NEEDMORE_P(r)) {
char cbuf[8], *p = cbuf;
@@ -4197,6 +4196,9 @@ rb_io_each_codepoint(VALUE io)
}
}
return io;
+
+ invalid:
+ rb_raise(rb_eArgError, "invalid byte sequence in %s", rb_enc_name(enc));
}
/*