Skip to content

Commit

Permalink
Fix how radix returns results.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Aug 24, 2013
1 parent 485abe7 commit 0045428
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/coerce.c
Expand Up @@ -326,11 +326,13 @@ MVMObject * MVM_radix(MVMThreadContext *tc, MVMint64 radix, MVMString *str, MVMi
if (neg || flag & 0x01) { value = -value; }

/* initialize the object */
result = MVM_repr_alloc_init(tc, tc->instance->boot_types->BOOTNumArray);

MVM_repr_push_n(tc, result, value);
MVM_repr_push_n(tc, result, base);
MVM_repr_push_n(tc, result, pos);
result = MVM_repr_alloc_init(tc, MVM_hll_current(tc)->slurpy_array_type);
MVMROOT(tc, result, {
MVMObject *box_type = MVM_hll_current(tc)->num_box_type;
MVM_repr_push_o(tc, result, MVM_repr_box_num(tc, box_type, value));
MVM_repr_push_o(tc, result, MVM_repr_box_num(tc, box_type, base));
MVM_repr_push_o(tc, result, MVM_repr_box_num(tc, box_type, pos));
});

return result;
}

0 comments on commit 0045428

Please sign in to comment.