Commit 39e9c6b
Return NULL for mmap fail case on Unix (#78069)
* Return NULL for mmap fail case on Unix
If mmap failed, "MAP_FAILED" is returned not "NULL".
The windows implememtation of GetRWMapping returns "NULL" for fail case,
and the caller function is also checking "NULL".
So, change Unix implementation to return "NULL" for fail case.
* call memset when mmap succeeds
* check MAP_FAILED instead of NULL
* return false for failing mmap
* Call g_fatalErrorHandler if releasing failed
* Update src/coreclr/utilcode/executableallocator.cpp
Co-authored-by: Jan Vorlicek <jan.vorlicek@volny.cz>
* Fix wrong condition check
Co-authored-by: Jan Vorlicek <jan.vorlicek@volny.cz>1 parent db21365 commit 39e9c6b
File tree
3 files changed
+15
-4
lines changed- src/coreclr
- minipal/Unix
- nativeaot/Runtime/unix
- utilcode
3 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
202 | 205 | | |
203 | 206 | | |
204 | 207 | | |
| |||
208 | 211 | | |
209 | 212 | | |
210 | 213 | | |
211 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
743 | 743 | | |
744 | 744 | | |
745 | 745 | | |
746 | | - | |
| 746 | + | |
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
457 | 460 | | |
458 | 461 | | |
459 | 462 | | |
| |||
0 commit comments