From fdeb5f55ec5859dfe43e155ca53bdcc5d25607e2 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Sat, 9 Feb 2002 10:02:03 +0000 Subject: [PATCH] hb_strUpper() call for pcode strings bug fixed --- harbour/source/vm/hvm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 89242e134c..48ad5c24ec 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -4010,7 +4010,11 @@ static void hb_vmPushAliasedVar( PHB_SYMB pSym ) if( HB_IS_STRING( pAlias ) ) { - char * szAlias = hb_strUpper( pAlias->item.asString.value, pAlias->item.asString.length ); + /* We make a copy of the string as it may be a pcode string! */ + char * szAlias = ( char * ) hb_xgrab( pAlias->item.asString.length + 1 ); + + hb_xmemcpy( szAlias, pAlias->item.asString.value, pAlias->item.asString.length + 1 ); + hb_strUpper( szAlias, pAlias->item.asString.length ); if( szAlias[ 0 ] == 'M' && szAlias[ 1 ] == '\0' ) { /* M->variable */ @@ -4040,7 +4044,7 @@ static void hb_vmPushAliasedVar( PHB_SYMB pSym ) } } } - + hb_xfree( ( void * ) szAlias ); } else hb_vmPushAliasedField( pSym );