From 6d00fe31f27dda4cccb77c7bd828dd8d5cac1682 Mon Sep 17 00:00:00 2001 From: chromatic Date: Tue, 18 Nov 2008 20:29:57 +0000 Subject: [PATCH] [lib] Fixed the CONTEXT(interp)->current_pc setting code from r32804; the goto code has to be a single expression, otherwise testC and similar cores will hang. git-svn-id: https://svn.parrot.org/parrot/trunk@32826 d31e2699-5ff4-0310-a27c-f18f2fbe73fe --- lib/Parrot/OpTrans/CGP.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Parrot/OpTrans/CGP.pm b/lib/Parrot/OpTrans/CGP.pm index 161d2f8d2d..c30673be19 100644 --- a/lib/Parrot/OpTrans/CGP.pm +++ b/lib/Parrot/OpTrans/CGP.pm @@ -106,8 +106,9 @@ relevant C code. sub goto_offset { my ( $self, $offset ) = @_; - return "CONTEXT(interp)->current_pc = CUR_OPCODE + $offset;\n" - . "goto **(void **)(cur_opcode += $offset)"; + # this must be a single expression, in case it's in a single-statement if + return "do {\nCONTEXT(interp)->current_pc = CUR_OPCODE + $offset;\n" + . "goto **(void **)(cur_opcode += $offset);\n} while (1)"; } =item C