Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove unnecessary casting of cur_opcode

  • Loading branch information...
commit 945d1c8b0591591e4fff4a4fa24713a39998d3d6 1 parent 581af05
@petdance petdance authored
View
4 compilers/opsc/src/Ops/Trans/C.pm
@@ -1,5 +1,5 @@
#! nqp
-# Copyright (C) 2010-2011, Parrot Foundation.
+# Copyright (C) 2010-2012, Parrot Foundation.
class Ops::Trans::C is Ops::Trans;
@@ -90,7 +90,7 @@ method restart_offset($offset) {
method goto_address($addr) { "return (opcode_t *)$addr"; }
-method goto_offset($offset) { "return (opcode_t *)cur_opcode + $offset"; }
+method goto_offset($offset) { "return cur_opcode + $offset"; }
method expr_address($addr) { $addr; }
View
4 t/compilers/opsc/03-past.t
@@ -1,5 +1,5 @@
#! ./parrot-nqp
-# Copyright (C) 2010, Parrot Foundation.
+# Copyright (C) 2010-2012, Parrot Foundation.
# "Comprehensive" test for creating PAST for op.
@@ -101,7 +101,7 @@ ok( $op.arg_types.join('_') eq 'i_pc_nc', "Second variant correct");
# Check body munching.
$op := @ops[0];
-ok( $op.get_body($trans) ~~ /'return (opcode_t *)cur_opcode + 1'/ , "goto NEXT appended for non :flow ops");
+ok( $op.get_body($trans) ~~ /'return cur_opcode + 1'/ , "goto NEXT appended for non :flow ops");
# Check write barriers.
ok( !$op.need_write_barrier, "Write Barrier is not required");
View
4 t/compilers/opsc/08-emitter.t
@@ -1,5 +1,5 @@
#! ./parrot-nqp
-# Copyright (C) 2010, Parrot Foundation.
+# Copyright (C) 2010-2012, Parrot Foundation.
pir::load_bytecode("opsc.pbc");
@@ -88,7 +88,7 @@ inline op branch(in LABEL) :base_loop :flow {
goto OFFSET($1);
}';
$new_body := translate_op_body($trans, $op_body);
-$restart_addr_ok := $new_body ~~ /'return (opcode_t *)cur_opcode + IREG(1);'/;
+$restart_addr_ok := $new_body ~~ /'return cur_opcode + IREG(1);'/;
ok($restart_addr_ok, "goto OFFSET() and \$1 translated ok");
ok($new_body ~~ /'PARROT_JUMP_RELATIVE'/, "jump flags generated");
Please sign in to comment.
Something went wrong with that request. Please try again.