From 7b0cd0ecb053c74da1531b3f4de4f6484b4c817e Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sun, 8 Feb 2004 23:01:34 +0000 Subject: [PATCH] A jumptoeof must fall through rule invocations as well. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6529 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/jam/compile.c | 16 ++++++++++++---- src/tools/jam/compile.h | 2 +- src/tools/jam/headers.c | 5 ++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/tools/jam/compile.c b/src/tools/jam/compile.c index 94c1bdc4b9..5eb32e37f1 100644 --- a/src/tools/jam/compile.c +++ b/src/tools/jam/compile.c @@ -515,7 +515,15 @@ compile_rule( /* Run rules, appending results from each */ for( l = ll; l; l = list_next( l ) ) - result = evaluate_rule( l->string, nargs, result ); + { + int localJmp = JMP_NONE; + result = evaluate_rule( l->string, nargs, result, &localJmp ); + if (localJmp == JMP_EOF) + { + *jmp = JMP_EOF; + break; + } + } list_free( ll ); lol_free( nargs ); @@ -531,7 +539,8 @@ LIST * evaluate_rule( const char *rulename, LOL *args, - LIST *result ) + LIST *result, + int *jmp ) { RULE *rule = bindrule( rulename ); @@ -576,7 +585,6 @@ evaluate_rule( { PARSE *parse = rule->procedure; SETTINGS *s = 0; - int jmp = JMP_NONE; LIST *l; int i; @@ -593,7 +601,7 @@ evaluate_rule( parse_refer( parse ); pushsettings( s ); - result = list_append( result, (*parse->func)( parse, args, &jmp ) ); + result = list_append( result, (*parse->func)( parse, args, jmp ) ); popsettings( s ); freesettings( s ); diff --git a/src/tools/jam/compile.h b/src/tools/jam/compile.h index ab7b5e6460..220281ae08 100644 --- a/src/tools/jam/compile.h +++ b/src/tools/jam/compile.h @@ -36,7 +36,7 @@ LIST *compile_settings( PARSE *parse, LOL *args, int *jmp ); LIST *compile_switch( PARSE *parse, LOL *args, int *jmp ); LIST *compile_while( PARSE *parse, LOL *args, int *jmp ); -LIST *evaluate_rule( const char *rulename, LOL *args, LIST *result ); +LIST *evaluate_rule( const char *rulename, LOL *args, LIST *result, int *jmp ); /* Conditions for compile_if() */ diff --git a/src/tools/jam/headers.c b/src/tools/jam/headers.c index c1513d185e..86f31d1110 100644 --- a/src/tools/jam/headers.c +++ b/src/tools/jam/headers.c @@ -81,7 +81,10 @@ headers( TARGET *t ) #endif if( lol_get( &lol, 1 ) ) - list_free( evaluate_rule( hdrrule->string, &lol, L0 ) ); + { + int jmp = JMP_NONE; + list_free( evaluate_rule( hdrrule->string, &lol, L0, &jmp ) ); + } /* Clean up */