Skip to content

Commit

Permalink
Fix the CStr REPR's copy_to function
Browse files Browse the repository at this point in the history
Its code was copy-pasted from CPointer with no changes whatsoever. This
changes it so it actually does what it's supposed to be doing.
  • Loading branch information
Kaiepi committed Jul 5, 2019
1 parent 729303d commit 47cd6c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/6model/reprs/CStr.c
Expand Up @@ -24,9 +24,10 @@ static void compose(MVMThreadContext *tc, MVMSTable *st, MVMObject *info) {

/* Copies to the body of one object to another. */
static void copy_to(MVMThreadContext *tc, MVMSTable *st, void *src, MVMObject *dest_root, void *dest) {
MVMCPointerBody *src_body = (MVMCPointerBody *)src;
MVMCPointerBody *dest_body = (MVMCPointerBody *)dest;
dest_body->ptr = src_body->ptr;
MVMCStrBody *src_body = (MVMCStrBody *)src;
MVMCStrBody *dest_body = (MVMCStrBody *)dest;
MVM_ASSIGN_REF(tc, &(dest_root->header), dest_body->orig, src_body->orig);
dest_body->cstr = src_body->cstr;
}

static void set_str(MVMThreadContext *tc, MVMSTable *st, MVMObject *root, void *data, MVMString *value) {
Expand Down

0 comments on commit 47cd6c6

Please sign in to comment.