提交 9c724e48 编写于 作者: B Behdad Esfahbod

[serializer] Add err_propagaged_error()

上级 ae8da4b6
...@@ -121,7 +121,7 @@ struct hb_serialize_context_t ...@@ -121,7 +121,7 @@ struct hb_serialize_context_t
} }
bool propagate_error (bool success) bool propagate_error (bool success)
{ return this->successful = this->successful && success; } { return this->successful && (success || (err_propagated_error (), false)); }
template <typename T> bool propagate_error (T &&obj) template <typename T> bool propagate_error (T &&obj)
{ return propagate_error (!hb_deref_pointer (obj).in_error ()); } { return propagate_error (!hb_deref_pointer (obj).in_error ()); }
...@@ -322,8 +322,11 @@ struct hb_serialize_context_t ...@@ -322,8 +322,11 @@ struct hb_serialize_context_t
return ret; return ret;
} }
/* Following two functions exist to allow setting breakpoint on. */
void void
err_ran_out_of_room () { this->ran_out_of_room = true; } err_ran_out_of_room () { this->ran_out_of_room = true; }
void
err_propagated_error () { this->successful = false; }
template <typename Type> template <typename Type>
Type *allocate_size (unsigned int size) Type *allocate_size (unsigned int size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册