| 52 | } |
| 53 | |
| 54 | WasmResult BufferBase::copyTo(WasmBase *wasm, size_t start, size_t length, uint64_t ptr_ptr, |
| 55 | uint64_t size_ptr) const { |
| 56 | if (owned_data_) { |
| 57 | std::string_view s(owned_data_.get() + start, length); |
| 58 | if (!wasm->copyToPointerSize(s, ptr_ptr, size_ptr)) { |
| 59 | return WasmResult::InvalidMemoryAccess; |
| 60 | } |
| 61 | return WasmResult::Ok; |
| 62 | } |
| 63 | std::string_view s = data_.substr(start, length); |
| 64 | if (!wasm->copyToPointerSize(s, ptr_ptr, size_ptr)) { |
| 65 | return WasmResult::InvalidMemoryAccess; |
| 66 | } |
| 67 | return WasmResult::Ok; |
| 68 | } |
| 69 | |
| 70 | // Test support. |
| 71 | uint32_t resolveQueueForTest(std::string_view vm_id, std::string_view queue_name) { |
no test coverage detected