mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
negative binary format should not be masked by 10bits; ref #3025
This commit is contained in:
@@ -79,10 +79,6 @@ mrb_fix2binstr(mrb_state *mrb, mrb_value x, int base)
|
||||
if (base != 2) {
|
||||
mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid radix %S", mrb_fixnum_value(base));
|
||||
}
|
||||
|
||||
if (val >= (1 << 10))
|
||||
val &= 0x3ff;
|
||||
|
||||
if (val == 0) {
|
||||
return mrb_str_new_lit(mrb, "0");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user