From edbc9a4ef75cad0dcd119efde281d739010dd9af Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 18 Jun 2010 13:05:20 +0000 Subject: [PATCH] 2010-06-18 15:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/vm/runner.c * include/hbcompdf.h ! Fixed two more HB_SIZE != HB_ULONG build issues. --- harbour/ChangeLog | 5 +++++ harbour/include/hbcompdf.h | 2 +- harbour/src/vm/runner.c | 9 +++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a0d6cfb8b8..fb9fdd2243 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-18 15:04 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/vm/runner.c + * include/hbcompdf.h + ! Fixed two more HB_SIZE != HB_ULONG build issues. + 2010-06-18 13:41 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/filesys.c * include/hbapifs.h diff --git a/harbour/include/hbcompdf.h b/harbour/include/hbcompdf.h index 02baaccfaa..777c997b74 100644 --- a/harbour/include/hbcompdf.h +++ b/harbour/include/hbcompdf.h @@ -667,7 +667,7 @@ typedef struct HB_MACRO_ /* a macro compiled pcode container */ /* macro compiler only members */ char * string; /* compiled string */ - HB_ULONG length; /* length of the string */ + HB_SIZE length; /* length of the string */ int Flags; /* some flags we may need */ int status; /* status of compilation */ HB_ITEM_PTR pError; /* error object returned from the parser */ diff --git a/harbour/src/vm/runner.c b/harbour/src/vm/runner.c index 70e92b9bb4..3a9b6afc17 100644 --- a/harbour/src/vm/runner.c +++ b/harbour/src/vm/runner.c @@ -322,6 +322,7 @@ static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE ulBodySize, HB_USHO HB_SIZE ulBodyOffset = 0; HB_SIZE ulSize; /* Size of function */ HB_SIZE ulPos; + HB_ULONG ulValue; HB_ULONG ul; char * buffer, ch; HB_USHORT usBind = ( usMode & HB_HRB_BIND_MODEMASK ); @@ -424,8 +425,12 @@ static PHRB_BODY hb_hrbLoad( const char * szHrbBody, HB_SIZE ulBodySize, HB_USHO break; /* Read size of function */ - if( ! hb_hrbReadValue( szHrbBody, ulBodySize, &ulBodyOffset, &ulSize ) || - ulBodyOffset + ulSize > ulBodySize ) + if( ! hb_hrbReadValue( szHrbBody, ulBodySize, &ulBodyOffset, &ulValue ) ) + break; + + ulSize = ( HB_SIZE ) ulValue; + + if( ulBodyOffset + ulSize > ulBodySize ) break; /* Copy function body */