Fix for pr2276163.

The VVP %join function was incorrectly treating the return from a
non-automatic function as a return from an automatic function in
the case that the non-automatic function result was being used as
a parameter to an automatic function. This patch fixes this error.
This commit is contained in:
Martin Whitaker 2008-11-15 14:21:20 +00:00 committed by Stephen Williams
parent 407ce5e152
commit fe199a7593
1 changed files with 11 additions and 7 deletions

View File

@ -2730,14 +2730,18 @@ bool of_JOIN(vthread_t thr, vvp_code_t cp)
assert(thr->fork_count > 0);
if (thr->wt_context != thr->rd_context) {
/* Pop the child context from the write context stack. */
vvp_context_t child_context = thr->wt_context;
thr->wt_context = vvp_get_stacked_context(child_context);
/* If the child thread is in an automatic scope... */
if (thr->child->wt_context) {
/* and is the top level task/function thread... */
if (thr->wt_context != thr->rd_context) {
/* Pop the child context from the write context stack. */
vvp_context_t child_context = thr->wt_context;
thr->wt_context = vvp_get_stacked_context(child_context);
/* Push the child context onto the read context stack */
vvp_set_stacked_context(child_context, thr->rd_context);
thr->rd_context = child_context;
/* Push the child context onto the read context stack */
vvp_set_stacked_context(child_context, thr->rd_context);
thr->rd_context = child_context;
}
}
/* If the child has already ended, reap it now. */