diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index 4ed04e99fa..420676a8aa 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -1021,14 +1021,29 @@ static HB_EXPR_FUNC( hb_compExprUseArrayAt ) case HB_EA_POP_PCODE: { + #ifndef HB_C52_STRICT + BOOL bRemoveRef = FALSE; + /* to manage strings as bytes arrays, they must be pushed by reference */ /* arrays also are passed by reference */ if( pSelf->value.asList.pExprList->ExprType == HB_ET_VARIABLE ) + { pSelf->value.asList.pExprList->ExprType = HB_ET_VARREF; + bRemoveRef = TRUE; + } + #endif HB_EXPR_USE( pSelf->value.asList.pExprList, HB_EA_PUSH_PCODE ); HB_EXPR_USE( pSelf->value.asList.pIndex, HB_EA_PUSH_PCODE ); HB_EXPR_GENPCODE1( hb_compGenPCode1, HB_P_ARRAYPOP ); + + #ifndef HB_C52_STRICT + if( bRemoveRef ) + { + pSelf->value.asList.pExprList->ExprType = HB_ET_VARIABLE; + } + #endif + } break; @@ -3470,4 +3485,4 @@ static HB_EXPR_FUNC( hb_compExprUsePreDec ) break; } return pSelf; -} \ No newline at end of file +}