Showing the changes to src/vm/module_reader.cpp (1 of 17 files). Show all
Unified · Split
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | #include <limits> |
| 9 | 9 | #include <memory> |
| 10 | 10 | #include <iostream> |
| 11 | −#include <fstream> | |
| 11 | +#include <sstream> | |
| 12 | 12 | #include <array> |
| 13 | 13 | #include <tuple> |
| 14 | 14 | #include <disvm.h> |
| @@ -739,20 +739,6 @@ vm_module_t::~vm_module_t() · 724 unmodified lines | ||
| 739 | 739 | original_mp->release(); |
| 740 | 740 | } |
| 741 | 741 | |
| 742 | −std::unique_ptr<vm_module_t> disvm::read_module(const char *path) | |
| 743 | −{ | |
| 744 | − assert(path != nullptr); | |
| 745 | − | |
| 746 | − auto module_file = std::ifstream{ path, std::ifstream::binary }; | |
| 747 | − if (!module_file.is_open()) | |
| 748 | − { | |
| 749 | − assert(false && "Failed to open module"); | |
| 750 | − throw vm_user_exception{ "Failed to open module" }; | |
| 751 | − } | |
| 752 | − | |
| 753 | − return read_module(module_file); | |
| 754 | −} | |
| 755 | − | |
| 756 | 742 | std::unique_ptr<runtime::vm_module_t> disvm::read_module(std::istream &data) |
| 757 | 743 | { |
| 758 | 744 | util::buffered_reader_t reader{ data }; |