From 04d01eb37b7f04fbd185577cc912cb3265b0fa63 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 6 Aug 2014 12:27:13 +0100 Subject: [PATCH] common: assert non-null ptrs in OnFinisher Callers should not be constructing C_OnFinisher if they have no context to call back. Signed-off-by: John Spray --- src/common/Finisher.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/Finisher.h b/src/common/Finisher.h index 610470eb4e1..229342079d8 100644 --- a/src/common/Finisher.h +++ b/src/common/Finisher.h @@ -122,7 +122,10 @@ class C_OnFinisher : public Context { Context *con; Finisher *fin; public: - C_OnFinisher(Context *c, Finisher *f) : con(c), fin(f) {} + C_OnFinisher(Context *c, Finisher *f) : con(c), fin(f) { + assert(fin != NULL); + assert(con != NULL); + } void finish(int r) { fin->queue(con, r); } -- 2.47.3