2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 12:22:17 +00:00

Fix the result of while.

[SVN r75945]
This commit is contained in:
Steven Watanabe
2011-12-14 21:49:34 +00:00
parent 01b1d78744
commit 295e3d222c
2 changed files with 19 additions and 0 deletions

View File

@@ -2192,6 +2192,8 @@ static void compile_parse( PARSE * parse, compiler * c, int result_location )
int nested_result = result_location == RESULT_NONE? RESULT_NONE : RESULT_RETURN;
int test = compile_new_label( c );
int top = compile_new_label( c );
/* Make sure that we return an empty list if the loop runs zero times. */
adjust_result( c, RESULT_NONE, nested_result );
/* Jump to the loop test */
compile_emit_branch( c, INSTR_JUMP, test );
compile_set_label( c, top );