From 916128e64b30de3f7e38481e101fee3174ae03c6 Mon Sep 17 00:00:00 2001 From: Alexander Astapchuk Date: Wed, 21 Mar 2007 12:27:32 +0600 Subject: [PATCH] [drlvm][jet]fix for HARMONY-3446, incorrect cascade JSR processing in .jet --- vm/jitrino/src/jet/compiler.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/vm/jitrino/src/jet/compiler.cpp b/vm/jitrino/src/jet/compiler.cpp index c11cfd1..c905661 100644 --- a/vm/jitrino/src/jet/compiler.cpp +++ b/vm/jitrino/src/jet/compiler.cpp @@ -888,15 +888,15 @@ bool Compiler::comp_gen_insts(unsigned pc, unsigned parentPC, BBState * parentState; { const BBInfo& parentBB = m_bbs[parentPC]; - // If we see that parent block was a JSR subroutine, this in fact - // means that the parent block ended with a JSR call, and then + // If we see that parent block was a JSR subroutine, this may mean + // that the parent block ended with a JSR call, and then // 'parentPC' of this block was substituted (see the appropriate // code in comp_gen_code_bb()). - // So, in this block we must use the state after the JSR subroutine. + // So, in this case we must use the state after the JSR subroutine. // The 'jsr_lead != parentPC' prevents from taking state from m_jsrStates // when the parentPC is the real parent, that is in a JSR subroutine // with several blocks. - if (parentBB.jsr_target && jsr_lead != parentPC) { + if (parentBB.jsr_target && jsr_lead != parentPC && jsr_lead != pc) { assert(m_jsrStates.find(parentPC) != m_jsrStates.end()); parentState = m_jsrStates[parentPC]; } -- 1.5.0.rc4