guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

220/376: Don't evaluate inside a "throw"


From: Ludovic Courtès
Subject: 220/376: Don't evaluate inside a "throw"
Date: Wed, 28 Jan 2015 22:05:11 +0000

civodul pushed a commit to tag 1.8
in repository guix.

commit 53b044c2f6f9e309037d5545374a7d257dbbb590
Author: Eelco Dolstra <address@hidden>
Date:   Mon Sep 22 18:49:49 2014 +0200

    Don't evaluate inside a "throw"
    
    Workaround for
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41174. This caused
    hydra-eval-jobs to ignore SIGINT.
---
 src/libexpr/primops.cc |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index a25bd88..0892d5d 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -333,15 +333,16 @@ static void prim_genericClosure(EvalState & state, const 
Pos & pos, Value * * ar
 static void prim_abort(EvalState & state, const Pos & pos, Value * * args, 
Value & v)
 {
     PathSet context;
-    throw Abort(format("evaluation aborted with the following error message: 
‘%1%’") %
-        state.coerceToString(pos, *args[0], context));
+    string s = state.coerceToString(pos, *args[0], context);
+    throw Abort(format("evaluation aborted with the following error message: 
‘%1%’") % s);
 }
 
 
 static void prim_throw(EvalState & state, const Pos & pos, Value * * args, 
Value & v)
 {
     PathSet context;
-    throw ThrownError(format("%1%") % state.coerceToString(pos, *args[0], 
context));
+    string s = state.coerceToString(pos, *args[0], context);
+    throw ThrownError(s);
 }
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]