Commit 9cabd637 authored by Milo Yip's avatar Milo Yip Committed by GitHub

Merge pull request #870 from StilesCrisis/null-handler-fix

Null handler fix
parents 97e2f7f1 4643104b
......@@ -1928,7 +1928,7 @@ private:
const Context& CurrentContext() const { return *schemaStack_.template Top<Context>(); }
OutputHandler& CreateNullHandler() {
return *(nullHandler_ = static_cast<OutputHandler*>(GetStateAllocator().Malloc(sizeof(OutputHandler))));
return *(nullHandler_ = new (GetStateAllocator().Malloc(sizeof(OutputHandler))) OutputHandler);
}
static const size_t kDefaultSchemaStackCapacity = 1024;
......
......@@ -1281,6 +1281,12 @@ TEST(SchemaValidatingWriter, Simple) {
EXPECT_TRUE(validator.GetInvalidDocumentPointer() == SchemaDocument::PointerType(""));
}
TEST(Schema, Issue848) {
rapidjson::Document d;
rapidjson::SchemaDocument s(d);
rapidjson::GenericSchemaValidator<rapidjson::SchemaDocument, rapidjson::Document> v(s);
}
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
static SchemaDocument ReturnSchemaDocument() {
......
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