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 */