From b0059483c8e57489083a01b07e877226367a1fce Mon Sep 17 00:00:00 2001 From: Milo Yip Date: Fri, 27 Jun 2014 22:13:02 +0800 Subject: [PATCH] Error can only be assigned once --- include/rapidjson/reader.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/rapidjson/reader.h b/include/rapidjson/reader.h index 5483bd7..ff4b098 100644 --- a/include/rapidjson/reader.h +++ b/include/rapidjson/reader.h @@ -23,11 +23,10 @@ #ifndef RAPIDJSON_PARSE_ERROR_NORETURN #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \ RAPIDJSON_MULTILINEMACRO_BEGIN \ - if (!HasParseError()) {\ + RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \ parseErrorCode_ = parseErrorCode; \ - errorOffset_ = offset; \ - }\ -RAPIDJSON_MULTILINEMACRO_END + errorOffset_ = offset; \ + RAPIDJSON_MULTILINEMACRO_END #endif #ifndef RAPIDJSON_PARSE_ERROR