From ea7010429ae2a93f3cec53afd1daf84ca585577e Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 28 Jul 2011 11:07:03 +0000 Subject: [PATCH] 2011-07-28 13:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/compiler/cmdcheck.c ! added workaround for what it seems like a clang bug in latest Apple XCode 4.1 'Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)', manifesting in this error: --- /Developer/usr/bin/clang -I. -I../../../../../include -fno-common -W -Wall -O3 -o cmdcheck.o -c ../../../cmdcheck.c clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal 1 (use -v to see invocation) --- The fix simply introduces a new variable to use ptr reference instead of indexed vector access in one specific loop. Please review/refix it, I didn't make functional tests. --- harbour/ChangeLog | 14 ++++++++++++++ harbour/src/compiler/cmdcheck.c | 6 +++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index eed10544b9..863f6554c4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,20 @@ The license applies to all entries newer than 2009-04-28. */ +2011-07-28 13:02 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/compiler/cmdcheck.c + ! added workaround for what it seems like a clang bug in latest Apple XCode 4.1 + 'Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)', + manifesting in this error: + --- + /Developer/usr/bin/clang -I. -I../../../../../include -fno-common -W -Wall -O3 -o cmdcheck.o -c ../../../cmdcheck.c + clang: error: unable to execute command: Segmentation fault: 11 + clang: error: clang frontend command failed due to signal 1 (use -v to see invocation) + --- + The fix simply introduces a new variable to use ptr reference instead of + indexed vector access in one specific loop. + Please review/refix it, I didn't make functional tests. + 2011-07-28 00:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/src/vm/hvm.c ! fixed infinite error retry loop when variable is create inside diff --git a/harbour/src/compiler/cmdcheck.c b/harbour/src/compiler/cmdcheck.c index bfbedb24fd..7c576672df 100644 --- a/harbour/src/compiler/cmdcheck.c +++ b/harbour/src/compiler/cmdcheck.c @@ -1040,9 +1040,13 @@ void hb_compChkCompilerSwitch( HB_COMP_DECL, int iArg, const char * const Args[] while( !HB_COMP_PARAM->fExit ) { int j = 1; + const char *szSwitch1 = szSwitch + j; /* hack to avoid what is seems a bug in 'Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)' / XCode 4.1 [vszakats] */ - while( szSwitch[j] && !HB_ISOPTSEP( szSwitch[j] ) ) + while( *szSwitch1 && !HB_ISOPTSEP( *szSwitch1 ) ) + { j++; + szSwitch1++; + } if( szSwitch[j] && szSwitch[j] == '/' ) {