From e58b37da884422a17832aea1c9f61b49e68e4ad9 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 24 Sep 2008 18:31:00 +0000 Subject: [PATCH] 2008-09-24 20:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/vm/estack.c ! fixed stack preloading - it should be after checking if stack exist :) --- harbour/ChangeLog | 5 +++++ harbour/source/vm/estack.c | 34 +++++++++++++++++++++------------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 57c6ff12be..10030c314b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,11 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-09-24 20:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/vm/estack.c + ! fixed stack preloading - it should be after checking if stack + exist :) + 2008-09-24 18:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/bin/hb-func.sh * reverted modification for import attributes - this will be changed diff --git a/harbour/source/vm/estack.c b/harbour/source/vm/estack.c index 12addf0ba0..8d8dacb940 100644 --- a/harbour/source/vm/estack.c +++ b/harbour/source/vm/estack.c @@ -757,10 +757,10 @@ char * hb_stackDateBuffer( void ) BYTE * hb_stackDirBuffer( void ) { - HB_STACK_TLS_PRELOAD #if defined( HB_MT_VM ) if( hb_stack_ready() ) { + HB_STACK_TLS_PRELOAD if( !hb_stack.byDirBuffer ) hb_stack.byDirBuffer = ( BYTE * ) hb_xgrab( _POSIX_PATH_MAX + 1 ); return hb_stack.byDirBuffer; @@ -771,10 +771,12 @@ BYTE * hb_stackDirBuffer( void ) PHB_IOERRORS hb_stackIOErrors( void ) { - HB_STACK_TLS_PRELOAD #if defined( HB_MT_VM ) if( hb_stack_ready() ) + { + HB_STACK_TLS_PRELOAD return &hb_stack.IOErrors; + } #endif return &s_IOErrors; } @@ -932,7 +934,6 @@ LONG hb_stackBaseProcOffset( int iLevel ) void hb_stackBaseProcInfo( char * szProcName, USHORT * puiProcLine ) { - HB_STACK_TLS_PRELOAD /* * This function is called by FM module and has to be ready for execution * before hb_stack initialization, [druzus] @@ -940,19 +941,26 @@ void hb_stackBaseProcInfo( char * szProcName, USHORT * puiProcLine ) */ #if defined( HB_MT_VM ) - if( hb_stack_ready() && hb_stack.pPos > hb_stack.pBase ) -#else - if( hb_stack.pPos > hb_stack.pBase ) -#endif - { - hb_strncpy( szProcName, ( * hb_stack.pBase )->item.asSymbol.value->szName, - HB_SYMBOL_NAME_LEN ); - * puiProcLine = ( * hb_stack.pBase )->item.asSymbol.stackstate->uiLineNo; - } - else + if( !hb_stack_ready() ) { szProcName[ 0 ] = '\0'; * puiProcLine = 0; + return; + } +#endif + { + HB_STACK_TLS_PRELOAD + if( hb_stack.pPos > hb_stack.pBase ) + { + hb_strncpy( szProcName, ( * hb_stack.pBase )->item.asSymbol.value->szName, + HB_SYMBOL_NAME_LEN ); + * puiProcLine = ( * hb_stack.pBase )->item.asSymbol.stackstate->uiLineNo; + } + else + { + szProcName[ 0 ] = '\0'; + * puiProcLine = 0; + } } }