Commit b5ef16ba authored by yui-knk's avatar yui-knk

Change to always use locals->car->car.

When p->locals->car is not NULL and p->locals->car->car is NULL,
local_add_f dose not append sym to p->locals->car->car.
This commit change to append sym to p->locals->car->car.
This will close #2333.
parent a22495df
...@@ -257,7 +257,11 @@ local_var_p(parser_state *p, mrb_sym sym) ...@@ -257,7 +257,11 @@ local_var_p(parser_state *p, mrb_sym sym)
static void static void
local_add_f(parser_state *p, mrb_sym sym) local_add_f(parser_state *p, mrb_sym sym)
{ {
if (p->locals->car && !p->locals->car->car) {
p->locals->car->car = nsym(sym);
} else {
p->locals->car = push(p->locals->car, nsym(sym)); p->locals->car = push(p->locals->car, nsym(sym));
}
} }
static void static void
......
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