From 8fd3f0ecce5264ee14c1a75cc42aae05baa1bb34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Mon, 25 Jun 2012 16:29:57 +0000 Subject: [PATCH] Boost Jam code cleanup - rearranged popping state off the main build state machine stack after executing an external process command so that we do not use data from a freed state node. Freed state nodes actually get transferred to some 'freed state node list' so they still exist and this was not causing access violations but it was still a smell. [SVN r79087] --- v2/engine/make1.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/v2/engine/make1.c b/v2/engine/make1.c index 7c36617b4..f850a889e 100644 --- a/v2/engine/make1.c +++ b/v2/engine/make1.c @@ -543,15 +543,15 @@ static void make1c( state * pState ) } else { - /* Pop state first because exec_wait() will push state. */ - pop_state( &state_stack ); + /* Increment the jobs running counter. */ + ++cmdsrunning; /* Execute the actual build command. */ exec_cmd( cmd->buf, make_closure, pState->t, cmd->shell, rule_name, target_name ); - /* Increment the jobs running counter. */ - ++cmdsrunning; + /* Pop state first because exec_wait() will push state. */ + pop_state( &state_stack ); /* Wait until we are under the concurrent command count limit. */ assert( 0 < globs.jobs );