| 404 | } |
| 405 | |
| 406 | Json formatLinkReferences(std::map<size_t, std::string> const& linkReferences) |
| 407 | { |
| 408 | Json ret = Json::object(); |
| 409 | |
| 410 | for (auto const& ref: linkReferences) |
| 411 | { |
| 412 | std::string const& fullname = ref.second; |
| 413 | |
| 414 | // If the link reference does not contain a colon, assume that the file name is missing and |
| 415 | // the whole string represents the library name. |
| 416 | size_t colon = fullname.rfind(':'); |
| 417 | std::string file = (colon != std::string::npos ? fullname.substr(0, colon) : ""); |
| 418 | std::string name = (colon != std::string::npos ? fullname.substr(colon + 1) : fullname); |
| 419 | |
| 420 | Json fileObject = ret.value(file, Json::object()); |
| 421 | Json libraryArray = fileObject.value(name, Json::array()); |
| 422 | |
| 423 | Json entry; |
| 424 | entry["start"] = Json(ref.first); |
| 425 | entry["length"] = 20; |
| 426 | |
| 427 | libraryArray.emplace_back(entry); |
| 428 | fileObject[name] = libraryArray; |
| 429 | ret[file] = fileObject; |
| 430 | } |
| 431 | |
| 432 | return ret; |
| 433 | } |
| 434 | |
| 435 | Json formatImmutableReferences(std::map<u256, evmasm::LinkerObject::ImmutableRefs> const& _immutableReferences) |
| 436 | { |
no test coverage detected