| 1064 | } |
| 1065 | |
| 1066 | Error CodeHolder::copySectionData(void* dst, size_t dstSize, uint32_t sectionId, CopySectionFlags copyFlags) noexcept { |
| 1067 | if (ASMJIT_UNLIKELY(!isSectionValid(sectionId))) |
| 1068 | return DebugUtils::errored(kErrorInvalidSection); |
| 1069 | |
| 1070 | Section* section = sectionById(sectionId); |
| 1071 | size_t bufferSize = section->bufferSize(); |
| 1072 | |
| 1073 | if (ASMJIT_UNLIKELY(dstSize < bufferSize)) |
| 1074 | return DebugUtils::errored(kErrorInvalidArgument); |
| 1075 | |
| 1076 | memcpy(dst, section->data(), bufferSize); |
| 1077 | |
| 1078 | if (bufferSize < dstSize && Support::test(copyFlags, CopySectionFlags::kPadSectionBuffer)) { |
| 1079 | size_t paddingSize = dstSize - bufferSize; |
| 1080 | memset(static_cast<uint8_t*>(dst) + bufferSize, 0, paddingSize); |
| 1081 | } |
| 1082 | |
| 1083 | return kErrorOk; |
| 1084 | } |
| 1085 | |
| 1086 | Error CodeHolder::copyFlattenedData(void* dst, size_t dstSize, CopySectionFlags copyFlags) noexcept { |
| 1087 | size_t end = 0; |
nothing calls this directly
no test coverage detected