From 9c8b68a905871882905fad6ca72c499a98bc2513 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 11 Jan 2014 16:10:02 -0500 Subject: * main.c (die): Close output_context AND make_sync. die() can be invoked inside a separate output_context, if the $(error ...) function is expanded as part of a recipe. --- main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index fa0498f..27d3a6e 100644 --- a/main.c +++ b/main.c @@ -3406,9 +3406,14 @@ die (int status) if (output_context) { - assert (output_context == &make_sync); + /* die() might be called in a recipe output context due to an + $(error ...) function. */ + output_close (output_context); + + if (output_context != &make_sync) + output_close (&make_sync); + OUTPUT_UNSET (); - output_close (&make_sync); } output_close (NULL); -- cgit v1.2.3