Skip to content

Commit

Permalink
compile_files() catch read error
Browse files Browse the repository at this point in the history
  • Loading branch information
madMAx43v3r committed Oct 23, 2024
1 parent 21b24c2 commit 76e466c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vm/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2103,6 +2103,9 @@ std::shared_ptr<const contract::Binary> compile_files(const std::vector<std::str
std::stringstream buffer;
for(const auto& src : file_names) {
std::ifstream stream(src);
if(!stream.good()) {
throw std::runtime_error("failed to read file: " + src);
}
buffer << stream.rdbuf();
}
return vm::compile(buffer.str(), flags);
Expand Down

0 comments on commit 76e466c

Please sign in to comment.