Symbols should work with MRB_USE_ALL_SYMBOLS; fix #5116

This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-11-26 10:32:19 +09:00
parent a33f9d7b65
commit 66f2e733e5
2 changed files with 5 additions and 2 deletions
+4
View File
@@ -8,7 +8,11 @@
#define MRUBY_PRESYM_H
#undef MRB_PRESYM_MAX
#ifdef MRB_USE_ALL_SYMBOLS
#define MRB_PRESYM_NAMED(lit, num, type, name) MRB_##type##__##name = (num),
#else
#define MRB_PRESYM_NAMED(lit, num, type, name) MRB_##type##__##name = (num<<1),
#endif
#define MRB_PRESYM_UNNAMED(lit, num)
enum mruby_presym {
+1 -2
View File
@@ -26,8 +26,7 @@ mrb_sym_all_symbols(mrb_state *mrb, mrb_value self)
mrb_value ary = mrb_ary_new_capa(mrb, mrb->symidx);
for (i=1, lim=mrb->symidx+1; i<lim; i++) {
mrb_sym sym = i<<1;
mrb_ary_push(mrb, ary, mrb_symbol_value(sym));
mrb_ary_push(mrb, ary, mrb_symbol_value(i+MRB_PRESYM_MAX));
}
return ary;