Skip to content

Commit 57bd72b

Browse files
committed
Merge pull request WebAssembly#301 from pjuftring/file-size_check
Repair broken file-size check
2 parents 2a6d834 + a20ae57 commit 57bd72b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/support/file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ T wasm::read_file(const std::string &filename, bool debug) {
2929
}
3030
infile.seekg(0, std::ios::end);
3131
std::streampos insize = infile.tellg();
32-
if (size_t(insize) >= std::numeric_limits<size_t>::max()) {
32+
if (uint64_t(insize) >= std::numeric_limits<size_t>::max()) {
3333
// Building a 32-bit executable where size_t == 32 bits, we are not able to create strings larger than 2^32 bytes in length, so must abort here.
3434
std::cerr << "Failed opening '" << filename << "': Input file too large: " << insize << " bytes. Try rebuilding in 64-bit mode." << std::endl;
3535
exit(EXIT_FAILURE);

0 commit comments

Comments
 (0)