diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index 6c978d2d03..4ed04e99fa 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -1021,6 +1021,11 @@ static HB_EXPR_FUNC( hb_compExprUseArrayAt ) case HB_EA_POP_PCODE: { + /* 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; + 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 );