Commit 4643104b authored by StilesCrisis's avatar StilesCrisis

Fix null handler construction

We should not malloc the null-handler object and cast to OutputHandler;
we need to actually invoke the constructor via placement new.
parent 0ec4e86f
......@@ -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;
......
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