@@ -73,9 +73,12 @@ nlohmann::json mergeFileFormatTwo(const std::string& wholeCGFilename, const std:
7373 } else {
7474 auto & c = wholeCG[it.key ()];
7575 auto & v = it.value ();
76+ if (v[" meta" ].is_null ()) {
77+ doMerge (c, v); // skip merging metadata
78+
7679 // TODO multiple bodies possible, if the body is in header?
7780 // TODO separate merge of meta information
78- if (v[" hasBody" ].get <bool >() && c[" hasBody" ].get <bool >()) {
81+ } else if (v[" hasBody" ].get <bool >() && c[" hasBody" ].get <bool >()) {
7982 // std::cout << "WARNING: merge of " << it.key()
8083 // << " has detected multiple bodies (equal number of statements would be good.)" << std::endl;
8184 // TODO check for equal values
@@ -105,10 +108,11 @@ nlohmann::json mergeFileFormatTwo(const std::string& wholeCGFilename, const std:
105108 // callees, isVirtual, doesOverride and overriddenFunctions unchanged
106109 // hasBody unchanged
107110 // numStatements unchanged
108- } else {
109- // nothing special
110- }
111- if (!c[" meta" ].contains (" estimateCallCount" ) && v[" meta" ].contains (" estimateCallCount" )) {
111+ }
112+
113+ if (c[" meta" ].is_null ()) {
114+ // Metadata is null, nothing to merge
115+ } else if (!c[" meta" ].contains (" estimateCallCount" ) && v[" meta" ].contains (" estimateCallCount" )) {
112116 c[" meta" ][" estimateCallCount" ] = v[" meta" ][" estimateCallCount" ];
113117 } else if (c[" meta" ].contains (" estimateCallCount" ) && v[" meta" ].contains (" estimateCallCount" )) {
114118 auto & ccalls = c[" meta" ][" estimateCallCount" ][" calls" ];
0 commit comments