diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ae09d8c67d..65f9b2f7ec 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,26 @@ The license applies to all entries newer than 2009-04-28. */ +2010-11-08 23:37 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/include/hbcompdf.h + * harbour/include/hbexprb.c + * harbour/src/common/expropt1.c + + added protection against pushing series of parameters on HVM + stack by hb_arrayToParams() function used in wrong contects, + i.e.: + var := hb_arrayToParams( { 1, 2, 3 } ) + Possible TODO: add compile time warning in such case. + + * harbour/contrib/hbexpat/3rd/expat/_hbconf.h + * harbour/contrib/hbexpat/3rd/expat/expat.hbp + * harbour/contrib/hbexpat/3rd/expat/xmltok.c + * harbour/contrib/hbexpat/3rd/expat/xmlrole.c + * harbour/contrib/hbexpat/3rd/expat/xmlparse.c + * updated to define endian setting using information from hbdefs.h + + * harbour/contrib/hbexpat/3rd/expat/xmltok.c + ! added missing members in structure initializations + 2010-11-08 22:28 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbexpat/3rd/expat/expat.hbp + *nix support. diff --git a/harbour/contrib/hbexpat/3rd/expat/_hbconf.h b/harbour/contrib/hbexpat/3rd/expat/_hbconf.h index ea3664fd54..8fbae27cb3 100644 --- a/harbour/contrib/hbexpat/3rd/expat/_hbconf.h +++ b/harbour/contrib/hbexpat/3rd/expat/_hbconf.h @@ -1,3 +1,31 @@ /* * $Id$ */ + +#ifndef _HBCONF_H +#define _HBCONF_H + +#include "hbdefs.h" +/* 1234 = LITLE_ENDIAN, 4321 = BIG_ENDIAN */ +#if defined( HB_LITTLE_ENDIAN ) +# define BYTEORDER 1234 +#elif defined( HB_BIG_ENDIAN ) +# define BYTEORDER 4321 +#else +# error Unsupported machine byte order (endian). +#endif + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to specify how much context to retain around the current parse + point. */ +#define XML_CONTEXT_BYTES 1024 + +/* Define to make parameter entity parsing functionality available. */ +#define XML_DTD 1 + +/* Define to make XML Namespaces functionality available. */ +#define XML_NS 1 + +#endif /* _HBCONF_H */ diff --git a/harbour/contrib/hbexpat/3rd/expat/expat.hbp b/harbour/contrib/hbexpat/3rd/expat/expat.hbp index 558658216d..4050bad88d 100644 --- a/harbour/contrib/hbexpat/3rd/expat/expat.hbp +++ b/harbour/contrib/hbexpat/3rd/expat/expat.hbp @@ -13,9 +13,8 @@ xmlparse.c xmlrole.c xmltok.c +-cflag=-DHARBOUR_CONF {hblib}-cflag=-DXML_STATIC -{allwin}-cflag=-DCOMPILED_FROM_DSP -{unix|os2}-cflag=-DHAVE_MEMMOVE {bcc}-cflag=-w-8057 {bcc}-cflag=-w-8008 {bcc}-cflag=-w-8066 diff --git a/harbour/contrib/hbexpat/3rd/expat/xmlparse.c b/harbour/contrib/hbexpat/3rd/expat/xmlparse.c index 69c8ab8bb2..6762f2915e 100644 --- a/harbour/contrib/hbexpat/3rd/expat/xmlparse.c +++ b/harbour/contrib/hbexpat/3rd/expat/xmlparse.c @@ -8,7 +8,9 @@ #define XML_BUILDING_EXPAT 1 -#ifdef COMPILED_FROM_DSP +#ifdef HARBOUR_CONF +#include "_hbconf.h" +#elif defined(COMPILED_FROM_DSP) #include "winconfi.h" #elif defined(MACOS_CLASSIC) #include "macconfi.h" diff --git a/harbour/contrib/hbexpat/3rd/expat/xmlrole.c b/harbour/contrib/hbexpat/3rd/expat/xmlrole.c index bca42ac90e..dd332d5686 100644 --- a/harbour/contrib/hbexpat/3rd/expat/xmlrole.c +++ b/harbour/contrib/hbexpat/3rd/expat/xmlrole.c @@ -4,7 +4,9 @@ #include -#ifdef COMPILED_FROM_DSP +#ifdef HARBOUR_CONF +#include "_hbconf.h" +#elif defined(COMPILED_FROM_DSP) #include "winconfi.h" #elif defined(MACOS_CLASSIC) #include "macconfi.h" diff --git a/harbour/contrib/hbexpat/3rd/expat/xmltok.c b/harbour/contrib/hbexpat/3rd/expat/xmltok.c index 1e9a7a4970..3ebfc38679 100644 --- a/harbour/contrib/hbexpat/3rd/expat/xmltok.c +++ b/harbour/contrib/hbexpat/3rd/expat/xmltok.c @@ -4,7 +4,9 @@ #include -#ifdef COMPILED_FROM_DSP +#ifdef HARBOUR_CONF +#include "_hbconf.h" +#elif defined(COMPILED_FROM_DSP) #include "winconfi.h" #elif defined(MACOS_CLASSIC) #include "macconfi.h" @@ -222,6 +224,17 @@ struct normal_encoding { E ## isInvalid3, \ E ## isInvalid4 +#define NULL_VTABLE() \ + NULL, \ + NULL, \ + NULL, \ + NULL, \ + NULL, \ + NULL, \ + NULL, \ + NULL, \ + NULL + static int FASTCALL checkCharRefNumber(int); #include "xmltok_i.h" @@ -467,7 +480,7 @@ static const struct normal_encoding latin1_encoding_ns = { #include "asciitab.h" #include "latin1ta.h" }, - STANDARD_VTABLE(sb_) + STANDARD_VTABLE(sb_) NULL_VTABLE() }; #endif @@ -480,7 +493,7 @@ static const struct normal_encoding latin1_encoding = { #undef BT_COLON #include "latin1ta.h" }, - STANDARD_VTABLE(sb_) + STANDARD_VTABLE(sb_) NULL_VTABLE() }; static void PTRCALL @@ -500,7 +513,7 @@ static const struct normal_encoding ascii_encoding_ns = { #include "asciitab.h" /* BT_NONXML == 0 */ }, - STANDARD_VTABLE(sb_) + STANDARD_VTABLE(sb_) NULL_VTABLE() }; #endif @@ -513,7 +526,7 @@ static const struct normal_encoding ascii_encoding = { #undef BT_COLON /* BT_NONXML == 0 */ }, - STANDARD_VTABLE(sb_) + STANDARD_VTABLE(sb_) NULL_VTABLE() }; static int PTRFASTCALL @@ -726,7 +739,7 @@ static const struct normal_encoding little2_encoding_ns = { #include "asciitab.h" #include "latin1ta.h" }, - STANDARD_VTABLE(little2_) + STANDARD_VTABLE(little2_) NULL_VTABLE() }; #endif @@ -745,7 +758,7 @@ static const struct normal_encoding little2_encoding = { #undef BT_COLON #include "latin1ta.h" }, - STANDARD_VTABLE(little2_) + STANDARD_VTABLE(little2_) NULL_VTABLE() }; #if BYTEORDER != 4321 @@ -758,7 +771,7 @@ static const struct normal_encoding internal_little2_encoding_ns = { #include "iasciita.h" #include "latin1ta.h" }, - STANDARD_VTABLE(little2_) + STANDARD_VTABLE(little2_) NULL_VTABLE() }; #endif @@ -771,7 +784,7 @@ static const struct normal_encoding internal_little2_encoding = { #undef BT_COLON #include "latin1ta.h" }, - STANDARD_VTABLE(little2_) + STANDARD_VTABLE(little2_) NULL_VTABLE() }; #endif @@ -867,7 +880,7 @@ static const struct normal_encoding big2_encoding_ns = { #include "asciitab.h" #include "latin1ta.h" }, - STANDARD_VTABLE(big2_) + STANDARD_VTABLE(big2_) NULL_VTABLE() }; #endif @@ -886,7 +899,7 @@ static const struct normal_encoding big2_encoding = { #undef BT_COLON #include "latin1ta.h" }, - STANDARD_VTABLE(big2_) + STANDARD_VTABLE(big2_) NULL_VTABLE() }; #if BYTEORDER != 1234 @@ -899,7 +912,7 @@ static const struct normal_encoding internal_big2_encoding_ns = { #include "iasciita.h" #include "latin1ta.h" }, - STANDARD_VTABLE(big2_) + STANDARD_VTABLE(big2_) NULL_VTABLE() }; #endif @@ -912,7 +925,7 @@ static const struct normal_encoding internal_big2_encoding = { #undef BT_COLON #include "latin1ta.h" }, - STANDARD_VTABLE(big2_) + STANDARD_VTABLE(big2_) NULL_VTABLE() }; #endif diff --git a/harbour/include/hbcompdf.h b/harbour/include/hbcompdf.h index a1d8eef6d6..b5b23c89f3 100644 --- a/harbour/include/hbcompdf.h +++ b/harbour/include/hbcompdf.h @@ -341,6 +341,7 @@ typedef enum #define HB_FN_UDF 0 #define HB_FN_RESERVED 1 +#define HB_FN_MULTIARG 2 typedef HB_USHORT HB_EXPRTYPE; diff --git a/harbour/include/hbexprb.c b/harbour/include/hbexprb.c index 6a8d3c68e6..ac3b29a956 100644 --- a/harbour/include/hbexprb.c +++ b/harbour/include/hbexprb.c @@ -2086,11 +2086,12 @@ static HB_EXPR_FUNC( hb_compExprUseFunCall ) if( pSelf->value.asFunCall.pFunName->ExprType == HB_ET_FUNNAME ) { - if( pSelf->value.asFunCall.pFunName->value.asSymbol.funcid == - HB_F_ARRAYTOPARAMS ) + if( pSelf->value.asFunCall.pFunName->value.asSymbol.funcid == HB_F_ARRAYTOPARAMS ) { usCount = ( HB_USHORT ) hb_compExprParamListCheck( HB_COMP_PARAM, pSelf->value.asFunCall.pParms ); - if( usCount == 1 && pSelf->value.asFunCall.pParms->ExprType != HB_ET_MACROARGLIST ) + if( usCount == 1 && + ( pSelf->value.asFunCall.pFunName->value.asSymbol.flags & HB_FN_MULTIARG ) != 0 && + pSelf->value.asFunCall.pParms->ExprType != HB_ET_MACROARGLIST ) { HB_EXPR_USE( pSelf->value.asFunCall.pParms, HB_EA_PUSH_PCODE ); HB_GEN_FUNC1( PCode1, HB_P_PUSHAPARAMS ); diff --git a/harbour/src/common/expropt1.c b/harbour/src/common/expropt1.c index 7ca95fcad9..1c5e8777ed 100644 --- a/harbour/src/common/expropt1.c +++ b/harbour/src/common/expropt1.c @@ -1348,6 +1348,8 @@ HB_SIZE hb_compExprParamListCheck( HB_COMP_DECL, HB_EXPR_PTR pExpr ) - handle it differently then in a normal statement */ if( pElem->ExprType == HB_ET_MACRO ) pElem->value.asMacro.SubType |= HB_ET_MACRO_LIST; + else if( pElem->ExprType == HB_ET_FUNCALL ) + pElem->value.asFunCall.pFunName->value.asSymbol.flags |= HB_FN_MULTIARG; if( nItems ) { nItems = 0;