Grow dual thread stack after pushing a thread on the next queue
The previous code was assuming it was fine to push_next without growing, which used to be the case with the previous implementation because we always have poped the current thread that we try to push. However now that we use a ring-buffer, m_next_begin == m_next_end can either mean full, or empty. We solve this by assuming it means empty and never allowing the buffer to become full, which means we need to grow after pushing to next if we get full. Fixes #4859
This commit is contained in:
parent
81787792d0
commit
cb3512f01e
|
@ -504,7 +504,6 @@ private:
|
||||||
if (start_desc and m_threads.next_is_empty())
|
if (start_desc and m_threads.next_is_empty())
|
||||||
to_next_start(pos, config, *start_desc);
|
to_next_start(pos, config, *start_desc);
|
||||||
m_threads.push_next({first_inst, -1});
|
m_threads.push_next({first_inst, -1});
|
||||||
m_threads.grow_ifn(false);
|
|
||||||
}
|
}
|
||||||
m_threads.swap_next();
|
m_threads.swap_next();
|
||||||
}
|
}
|
||||||
|
@ -632,7 +631,7 @@ private:
|
||||||
void push_current(Thread thread) { m_data[decrement(m_current)] = thread; grow_ifn(true); }
|
void push_current(Thread thread) { m_data[decrement(m_current)] = thread; grow_ifn(true); }
|
||||||
Thread pop_current() { return m_data[post_increment(m_current)]; }
|
Thread pop_current() { return m_data[post_increment(m_current)]; }
|
||||||
|
|
||||||
void push_next(Thread thread) { m_data[post_increment(m_next_end)] = thread; }
|
void push_next(Thread thread) { m_data[post_increment(m_next_end)] = thread; grow_ifn(false); }
|
||||||
Thread pop_next() { return m_data[decrement(m_next_end)]; }
|
Thread pop_next() { return m_data[decrement(m_next_end)]; }
|
||||||
|
|
||||||
void swap_next()
|
void swap_next()
|
||||||
|
|
1
test/regression/4859-regex-invalid-behaviour/cmd
Normal file
1
test/regression/4859-regex-invalid-behaviour/cmd
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ge<a-/><ret>d
|
3
test/regression/4859-regex-invalid-behaviour/in
Normal file
3
test/regression/4859-regex-invalid-behaviour/in
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
ddddd
|
||||||
|
aaaaa
|
||||||
|
bbbbb
|
1
test/regression/4859-regex-invalid-behaviour/out
Normal file
1
test/regression/4859-regex-invalid-behaviour/out
Normal file
|
@ -0,0 +1 @@
|
||||||
|
bbbbb
|
1
test/regression/4859-regex-invalid-behaviour/rc
Normal file
1
test/regression/4859-regex-invalid-behaviour/rc
Normal file
|
@ -0,0 +1 @@
|
||||||
|
reg slash '(?S)((^ {13}d.*\n)(^ {13}.*\n)*?)?^.'
|
Loading…
Reference in New Issue
Block a user