YJIT: don't show a full crash report if mmap is only out of memory (#6659)

This commit is contained in:
Noah Gibbs 2022-11-02 15:16:26 +00:00 committed by GitHub
parent 946bb34fb5
commit ee7c031dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
Notes: git 2022-11-02 15:16:46 +00:00
Merged-By: maximecb <maximecb@ruby-lang.org>

4
yjit.c
View File

@ -307,6 +307,10 @@ rb_yjit_reserve_addr_space(uint32_t mem_size)
// Check that the memory mapping was successful
if (mem_block == MAP_FAILED) {
perror("ruby: yjit: mmap:");
if(errno == ENOMEM) {
// No crash report if it's only insufficient memory
exit(EXIT_FAILURE);
}
rb_bug("mmap failed");
}