mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Improve error message when registering empty bundles
Summary: This change lets `registerBundle(bundleId, file)` throw an exception when the file is empty, improving on the current behavior of an eventual SIGABRT saying "MAP_FAILED: Invalid argument" Reviewed By: ridiculousfish Differential Revision: D16451938 fbshipit-source-id: b8b2d0bfed476319c379122fad59a5bf0a8c813b
This commit is contained in:
committed by
Facebook Github Bot
parent
8b5ed7abdd
commit
691679a790
@@ -110,6 +110,9 @@ static off_t maybeRemap(char *data, size_t size, int fd) {
|
||||
#endif // WITH_FBREMAP
|
||||
|
||||
const char *JSBigFileString::c_str() const {
|
||||
if (m_size == 0) {
|
||||
return "";
|
||||
}
|
||||
if (!m_data) {
|
||||
m_data =
|
||||
(const char *) mmap(0, m_size, PROT_READ, MAP_PRIVATE, m_fd, m_mapOff);
|
||||
|
||||
Reference in New Issue
Block a user