-
-
Save FROGGS/534f320aa548e12f75c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/core/interp.c b/src/core/interp.c | |
index 5760ad1..992ffdc 100644 | |
--- a/src/core/interp.c | |
+++ b/src/core/interp.c | |
@@ -2335,13 +2335,11 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex | |
box = MVM_intcache_get(tc, type, GET_REG(cur_op, 2).i64); | |
if (box == 0) { | |
box = REPR(type)->allocate(tc, STABLE(type)); | |
- MVMROOT(tc, box, { | |
- if (REPR(box)->initialize) | |
- REPR(box)->initialize(tc, STABLE(box), box, OBJECT_BODY(box)); | |
- REPR(box)->box_funcs.set_int(tc, STABLE(box), box, | |
- OBJECT_BODY(box), GET_REG(cur_op, 2).i64); | |
- GET_REG(cur_op, 0).o = box; | |
- }); | |
+ if (REPR(box)->initialize) | |
+ REPR(box)->initialize(tc, STABLE(box), box, OBJECT_BODY(box)); | |
+ REPR(box)->box_funcs.set_int(tc, STABLE(box), box, | |
+ OBJECT_BODY(box), GET_REG(cur_op, 2).i64); | |
+ GET_REG(cur_op, 0).o = box; | |
} else { | |
GET_REG(cur_op, 0).o = box; | |
} | |
@@ -2351,24 +2349,23 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex | |
OP(box_n): { | |
MVMObject *type = GET_REG(cur_op, 4).o; | |
MVMObject *box = REPR(type)->allocate(tc, STABLE(type)); | |
- MVMROOT(tc, box, { | |
- if (REPR(box)->initialize) | |
- REPR(box)->initialize(tc, STABLE(box), box, OBJECT_BODY(box)); | |
- REPR(box)->box_funcs.set_num(tc, STABLE(box), box, | |
- OBJECT_BODY(box), GET_REG(cur_op, 2).n64); | |
- GET_REG(cur_op, 0).o = box; | |
- }); | |
+ if (REPR(box)->initialize) | |
+ REPR(box)->initialize(tc, STABLE(box), box, OBJECT_BODY(box)); | |
+ REPR(box)->box_funcs.set_num(tc, STABLE(box), box, | |
+ OBJECT_BODY(box), GET_REG(cur_op, 2).n64); | |
+ GET_REG(cur_op, 0).o = box; | |
cur_op += 6; | |
goto NEXT; | |
} | |
OP(box_s): { | |
+ MVMString *str = GET_REG(cur_op, 2).s; | |
MVMObject *type = GET_REG(cur_op, 4).o; | |
- MVMObject *box = REPR(type)->allocate(tc, STABLE(type)); | |
- MVMROOT(tc, box, { | |
+ MVMROOT(tc, str, { | |
+ MVMObject *box = REPR(type)->allocate(tc, STABLE(type)); | |
if (REPR(box)->initialize) | |
REPR(box)->initialize(tc, STABLE(box), box, OBJECT_BODY(box)); | |
REPR(box)->box_funcs.set_str(tc, STABLE(box), box, | |
- OBJECT_BODY(box), GET_REG(cur_op, 2).s); | |
+ OBJECT_BODY(box), str); | |
GET_REG(cur_op, 0).o = box; | |
}); | |
cur_op += 6; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment