Unverified Commit acb1fdc7 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4212 from shuujii/pack-remove-float-check

pack: Remove redundant float check in pack_utf8()
parents cca19532 668d632c
...@@ -457,11 +457,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count, ...@@ -457,11 +457,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
int len = 0; int len = 0;
uint32_t c = 0; uint32_t c = 0;
#ifndef MRB_WITHOUT_FLOAT
if (mrb_float_p(o)) {
goto range_error;
}
#endif
c = (uint32_t)mrb_fixnum(o); c = (uint32_t)mrb_fixnum(o);
/* Unicode character */ /* Unicode character */
...@@ -489,9 +484,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count, ...@@ -489,9 +484,6 @@ pack_utf8(mrb_state *mrb, mrb_value o, mrb_value str, mrb_int sidx, long count,
len = 4; len = 4;
} }
else { else {
#ifndef MRB_WITHOUT_FLOAT
range_error:
#endif
mrb_raise(mrb, E_RANGE_ERROR, "pack(U): value out of range"); mrb_raise(mrb, E_RANGE_ERROR, "pack(U): value out of range");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment