@@ -494,9 +494,8 @@ class Schema {
494
494
// If we have an id property, resolve it with the in-scope id
495
495
if (const ValueType* v = GetMember (value, GetIdString ())) {
496
496
if (v->IsString ()) {
497
- UriType local = UriType (*v);
498
- local.Resolve (id_);
499
- id_ = local;
497
+ UriType local (*v, allocator);
498
+ id_ = local.Resolve (id_, allocator);
500
499
}
501
500
}
502
501
@@ -1659,7 +1658,7 @@ class GenericSchemaDocument {
1659
1658
1660
1659
Ch noUri[1 ] = {0 };
1661
1660
uri_.SetString (uri ? uri : noUri, uriLength, *allocator_);
1662
- docId_ = UriType (uri_);
1661
+ docId_ = UriType (uri_, allocator_ );
1663
1662
1664
1663
typeless_ = static_cast <SchemaType*>(allocator_->Malloc (sizeof (SchemaType)));
1665
1664
new (typeless_) SchemaType (this , PointerType (), ValueType (kObjectType ).Move (), ValueType (kObjectType ).Move (), allocator_, docId_);
@@ -1792,8 +1791,7 @@ class GenericSchemaDocument {
1792
1791
if (len > 0 ) {
1793
1792
// First resolve $ref against the in-scope id
1794
1793
UriType scopeId = id;
1795
- UriType ref = UriType (itr->value );
1796
- ref.Resolve (scopeId);
1794
+ UriType ref = UriType (itr->value , allocator_).Resolve (scopeId, allocator_);
1797
1795
// See if the resolved $ref minus the fragment matches a resolved id in this document
1798
1796
// Search from the root. Returns the subschema in the document and its absolute JSON pointer.
1799
1797
PointerType basePointer = PointerType ();
@@ -1851,7 +1849,7 @@ class GenericSchemaDocument {
1851
1849
// See if the fragment matches an id in this document.
1852
1850
// Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer.
1853
1851
PointerType pointer = PointerType ();
1854
- if (const ValueType *pv = FindId (*base, ref, pointer, UriType (ref.GetBase () ), true , basePointer)) {
1852
+ if (const ValueType *pv = FindId (*base, ref, pointer, UriType (ref.GetBaseString (), ref. GetBaseStringLength (), allocator_ ), true , basePointer)) {
1855
1853
if (!IsCyclicRef (pointer)) {
1856
1854
// GenericStringBuffer<EncodingType> sb;
1857
1855
// pointer.StringifyUriFragment(sb);
@@ -1887,8 +1885,7 @@ class GenericSchemaDocument {
1887
1885
// Establish the base URI of this object
1888
1886
typename ValueType::ConstMemberIterator m = doc.FindMember (SchemaType::GetIdString ());
1889
1887
if (m != doc.MemberEnd () && m->value .GetType () == kStringType ) {
1890
- localuri = UriType (m->value );
1891
- localuri.Resolve (baseuri);
1888
+ localuri = UriType (m->value , allocator_).Resolve (baseuri, allocator_);
1892
1889
}
1893
1890
// See if it matches
1894
1891
if (localuri.Match (finduri, full)) {
0 commit comments