Unverified Commit 4b3d7c2f authored by Milo Yip's avatar Milo Yip Committed by GitHub

Merge pull request #1506 from ylavic/CreatePattern

Add missing curly brackets in STDREGEX's CreatePattern().
parents 01950eb7 94fc4638
...@@ -1149,7 +1149,7 @@ private: ...@@ -1149,7 +1149,7 @@ private:
#elif RAPIDJSON_SCHEMA_USE_STDREGEX #elif RAPIDJSON_SCHEMA_USE_STDREGEX
template <typename ValueType> template <typename ValueType>
RegexType* CreatePattern(const ValueType& value) { RegexType* CreatePattern(const ValueType& value) {
if (value.IsString()) if (value.IsString()) {
RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType))); RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType)));
try { try {
return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript); return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
...@@ -1157,6 +1157,7 @@ private: ...@@ -1157,6 +1157,7 @@ private:
catch (const std::regex_error&) { catch (const std::regex_error&) {
AllocatorType::Free(r); AllocatorType::Free(r);
} }
}
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment