diff --git a/ecmascript/snapshot/mem/snapshot.cpp b/ecmascript/snapshot/mem/snapshot.cpp index ac357f2a5bc7e4dcc1e6732b92d292551548f869..33743b2f0679cfa32b2ea580b8cc67be2d06417b 100644 --- a/ecmascript/snapshot/mem/snapshot.cpp +++ b/ecmascript/snapshot/mem/snapshot.cpp @@ -206,11 +206,9 @@ bool Snapshot::Deserialize(SnapshotType type, const CString &snapshotFile, bool UNREACHABLE(); } - std::ifstream file(realPath); - if (!file.good()) { + if (!FileExist(realPath.c_str())) { return false; } - file.close(); SnapshotProcessor processor(vm_); if (isBuiltins) {