From 9c724e48a2f5d61c31c79f0b4660f08e5d07db10 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 22 Apr 2019 15:37:10 -0400 Subject: [PATCH] [serializer] Add err_propagaged_error() --- src/hb-serialize.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index 12b61534..b831ea62 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -121,7 +121,7 @@ struct hb_serialize_context_t } bool propagate_error (bool success) - { return this->successful = this->successful && success; } + { return this->successful && (success || (err_propagated_error (), false)); } template bool propagate_error (T &&obj) { return propagate_error (!hb_deref_pointer (obj).in_error ()); } @@ -322,8 +322,11 @@ struct hb_serialize_context_t return ret; } + /* Following two functions exist to allow setting breakpoint on. */ void err_ran_out_of_room () { this->ran_out_of_room = true; } + void + err_propagated_error () { this->successful = false; } template Type *allocate_size (unsigned int size) -- GitLab