Skip to content

Commit

Permalink
[core] better set_p_p? assertions #1024
Browse files Browse the repository at this point in the history
  • Loading branch information
Reini Urban committed Nov 22, 2014
1 parent 17897ad commit 4f11a9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ops/core_ops.c
Expand Up @@ -20472,15 +20472,15 @@ Parrot_set_s_nc(opcode_t *cur_opcode, PARROT_INTERP) {

opcode_t *
Parrot_set_p_pc(opcode_t *cur_opcode, PARROT_INTERP) {
PARROT_ASSERT((PCONST(2) || (!"Empty PMC in set_p_pc")));
PARROT_ASSERT(((cur_opcode[2] >= 0) || (!"Empty PMC in set_p_pc")));
PREG(1) = PCONST(2);
PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp));
return cur_opcode + 3;
}

opcode_t *
Parrot_set_p_p(opcode_t *cur_opcode, PARROT_INTERP) {
PARROT_ASSERT((PREG(2) || (!"Empty PMC in set_p_p")));
PARROT_ASSERT(((cur_opcode[2] >= 0) || (!"Empty PMC in set_p_p")));
PREG(1) = PREG(2);
PARROT_GC_WRITE_BARRIER(interp, CURRENT_CONTEXT(interp));
return cur_opcode + 3;
Expand Down
4 changes: 2 additions & 2 deletions src/ops/set.ops
Expand Up @@ -131,12 +131,12 @@ inline op set(out STR, in NUM) {
}

inline op set(out PMC, inconst PMC) {
PARROT_ASSERT($2 || !"Empty PMC in set_p_pc");
PARROT_ASSERT(cur_opcode[2] >=0 || !"Empty PMC in set_p_pc");
$1 = $2;
}

inline op set(out PMC, invar PMC) {
PARROT_ASSERT($2 || !"Empty PMC in set_p_p");
PARROT_ASSERT(cur_opcode[2] >=0 || !"Empty PMC in set_p_p");
$1 = $2;
}

Expand Down

0 comments on commit 4f11a9b

Please sign in to comment.