Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericStringRef: move assert out of expression #1013

Merged
merged 1 commit into from Jul 11, 2017

Conversation

pah
Copy link
Contributor

@pah pah commented Jul 10, 2017

As mentioned by @sagaceilo in 47c3c1e#commitcomment-23018046, some assert implementations don't support assertions inside of expressions.

As internal::StrLen should continue relying on the not-null guarantee, I moved the RAPIDJSON_ASSERT+StrLen sequence into a local function in GenericStringRef instead.

pah referenced this pull request Jul 10, 2017
 * Safely assert upon passing NULL string without length
   (requires usage of RAPIDJSON_ASSERT within an expression)
 * Allow using a NULL string together with an explicit length 0
   (GenericStringRef, GenericValue::SetString, ...), see #817
 * Add GenericValue::SetString(StringRefType, Allocator&) overload
 * Add tests for the various cases
@coveralls
Copy link

coveralls commented Jul 10, 2017

Coverage Status

Coverage increased (+5.0e-05%) to 99.918% when pulling 70171f9 on pah:fixes/1010-assert-stringref into 37ea16d on miloyip:master.

@miloyip miloyip merged commit 1a77513 into Tencent:master Jul 11, 2017
@pah pah deleted the fixes/1010-assert-stringref branch July 11, 2017 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants