Fixed JsonVariant::isNull() not returning true after set((char*)0)

This commit is contained in:
Benoit Blanchon
2019-02-18 16:04:51 +01:00
parent e9b4c6289b
commit 56bf24e1ec
13 changed files with 127 additions and 47 deletions

View File

@@ -4,6 +4,7 @@
#pragma once
#include "../Polyfills/gsl/not_null.hpp"
#include "../Polyfills/type_traits.hpp"
#include "../Variant/VariantContent.hpp"
@@ -67,14 +68,14 @@ class VariantSlot {
_next = VariantSlotDiff(slot - this);
}
void setOwnedKey(const char* k) {
void setOwnedKey(not_null<const char*> k) {
_flags |= KEY_IS_OWNED;
_key = k;
_key = k.get();
}
void setLinkedKey(const char* k) {
void setLinkedKey(not_null<const char*> k) {
_flags &= VALUE_MASK;
_key = k;
_key = k.get();
}
const char* key() const {