Skip to content

Commit

Permalink
Fix receive op using wrong interp for write access to mailbox
Browse files Browse the repository at this point in the history
VTABLE_shift_pmc is writing to the mailbox. This is ok, since it is
protected by the mailbox_lock, but of course we have to do this with the
partner's interp. Otherwise it would fail in the write barrier.
  • Loading branch information
niner committed Apr 15, 2012
1 parent 145ba94 commit c6e891e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ops/core_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -24275,7 +24275,7 @@ Parrot_receive_p(opcode_t *cur_opcode, PARROT_INTERP) {
}

if ((msg_count > 0)) {
PREG(1) = VTABLE_shift_pmc(interp, pdata->mailbox);
PREG(1) = VTABLE_shift_pmc(pdata->interp, pdata->mailbox);
Parrot_unblock_GC_mark(interp);
UNLOCK(pdata->mailbox_lock);
{
Expand Down
2 changes: 1 addition & 1 deletion src/ops/experimental.ops
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ op receive(out PMC) {
msg_count = VTABLE_elements(interp, pdata->mailbox);

if (msg_count > 0) {
$1 = VTABLE_shift_pmc(interp, pdata->mailbox);
$1 = VTABLE_shift_pmc(pdata->interp, pdata->mailbox);
Parrot_unblock_GC_mark(interp);
UNLOCK(pdata->mailbox_lock);
goto ADDRESS(dest);
Expand Down

0 comments on commit c6e891e

Please sign in to comment.