Commit 81cbc925 authored by dearblue's avatar dearblue

Fix inline packed symbols on 32 bit mode with MRB_WORD_BOXING

parent d1db959c
......@@ -34,13 +34,18 @@ static const char pack_table[] = "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRS
static mrb_sym
sym_inline_pack(const char *name, uint16_t len)
{
enum {
lower_length_max = (MRB_SYMBOL_BITSIZE - 2) / 5,
mix_length_max = (MRB_SYMBOL_BITSIZE - 2) / 6
};
char c;
const char *p;
int i;
mrb_sym sym = 0;
int lower = 1;
if (len > 6) return 0; /* too long */
if (len > lower_length_max) return 0; /* too long */
for (i=0; i<len; i++) {
uint32_t bits;
......@@ -64,7 +69,7 @@ sym_inline_pack(const char *name, uint16_t len)
}
return sym | 3;
}
if (len == 6) return 0;
if (len > mix_length_max) return 0;
return sym | 1;
}
......
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