@@ -1643,8 +1643,11 @@ int HConfig::getSizeMapVal(
1643
1643
1644
1644
//-----------------------------------------------------------------------------
1645
1645
inline string HConfig ::tagRef (YAML ::Node & self ){
1646
- string value = self .Tag ();
1646
+ string valueOrig = self .Tag ();
1647
+ string value = valueOrig ;
1648
+ bool mustReset = false;
1647
1649
if ((value == "?" ) || (value == "" )){
1650
+ mustReset = true;
1648
1651
// not a valid tag found -> implement implicit tag resolution
1649
1652
switch (self .Type ()){
1650
1653
case YAML ::NodeType ::Null :
@@ -1673,16 +1676,21 @@ inline string HConfig::tagRef(YAML::Node &self){
1673
1676
}
1674
1677
value = self .Tag (); // determine final outcome
1675
1678
}else if (value == "!" ){
1679
+ mustReset = true;
1676
1680
// yaml-cpp seems to do this for a quoted string
1677
1681
self .SetTag ("tag:yaml.org,2002:str" );
1678
1682
value = self .Tag (); // determine final outcome
1679
1683
}
1684
+ if (mustReset ) self .SetTag (valueOrig );
1680
1685
return value ;
1681
1686
}
1682
1687
//-----------------------------------------------------------------------------
1683
1688
inline string HConfig ::tag (YAML ::Node self ){
1684
- string value = self .Tag ();
1689
+ string valueOrig = self .Tag ();
1690
+ string value = valueOrig ;
1691
+ bool mustReset = false;
1685
1692
if ((value == "?" ) || (value == "" )){
1693
+ mustReset = true;
1686
1694
// not a valid tag found -> implement implicit tag resolution
1687
1695
switch (self .Type ()){
1688
1696
case YAML ::NodeType ::Null :
@@ -1711,10 +1719,12 @@ inline string HConfig::tag(YAML::Node self){
1711
1719
}
1712
1720
value = self .Tag (); // determine final outcome
1713
1721
}else if (value == "!" ){
1722
+ mustReset = true;
1714
1723
// yaml-cpp seems to do this for a quoted string
1715
1724
self .SetTag ("tag:yaml.org,2002:str" );
1716
1725
value = self .Tag (); // determine final outcome
1717
1726
}
1727
+ if (mustReset ) self .SetTag (valueOrig );
1718
1728
return value ;
1719
1729
}
1720
1730
//-----------------------------------------------------------------------------
0 commit comments