get rid of cycle check from push_arg
parent
47f24d6e2e
commit
9e82dc0d2f
|
@ -115,12 +115,6 @@ alias_impl::alias_impl(state &cs, string_ref name, any_value v, int fl):
|
||||||
}
|
}
|
||||||
|
|
||||||
void alias_impl::push_arg(any_value &v, ident_stack &st, bool um) {
|
void alias_impl::push_arg(any_value &v, ident_stack &st, bool um) {
|
||||||
if (p_astack == &st) {
|
|
||||||
/* prevent cycles and unnecessary code elsewhere */
|
|
||||||
p_val = std::move(v);
|
|
||||||
clean_code();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
st.val_s = std::move(p_val);
|
st.val_s = std::move(p_val);
|
||||||
st.next = p_astack;
|
st.next = p_astack;
|
||||||
p_astack = &st;
|
p_astack = &st;
|
||||||
|
|
|
@ -451,8 +451,14 @@ bool stacked_value::push() {
|
||||||
if (!p_a) {
|
if (!p_a) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
static_cast<alias_impl *>(p_a)->push_arg(*this, p_stack);
|
if (!p_pushed) {
|
||||||
p_pushed = true;
|
static_cast<alias_impl *>(p_a)->push_arg(*this, p_stack);
|
||||||
|
p_pushed = true;
|
||||||
|
} else {
|
||||||
|
static_cast<alias_impl *>(p_a)->p_val = std::move(
|
||||||
|
*static_cast<any_value *>(this)
|
||||||
|
);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue