make threads work

this means ensuring all required fields are set when creating
new threads. as well as respecting the "global" ident flags when
an alias is not pushed (in order to erase the UNKNOWN flag for
all threads)
master
Daniel Kolesa 2021-04-05 00:55:31 +02:00
parent c2de63be25
commit 59c0d16d50
2 changed files with 7 additions and 1 deletions

View File

@ -144,10 +144,14 @@ void alias_stack::set_arg(alias *a, thread_state &ts, any_value &v) {
node->val_s = std::move(v);
}
void alias_stack::set_alias(alias *, thread_state &ts, any_value &v) {
void alias_stack::set_alias(alias *a, thread_state &ts, any_value &v) {
node->val_s = std::move(v);
node->code = bcode_ref{};
flags = ts.ident_flags;
auto *imp = static_cast<alias_impl *>(a);
if (node == &imp->p_initial) {
imp->p_flags = flags;
}
}
/* public interface */

View File

@ -279,7 +279,9 @@ LIBCUBESCRIPT_EXPORT void state::destroy() {
state::state(internal_state *s) {
p_tstate = s->create<thread_state>(s);
p_tstate->pstate = this;
p_tstate->istate = s;
p_tstate->owner = false;
}
LIBCUBESCRIPT_EXPORT state state::new_thread() {