Commit a102a35
[2020-02] [mono][loader] Set status on success; avoid mmap on Android (#21610)
Manual backport of dotnet/runtime#80949 to mono/mono
Emebedders that call `mono_assembly_load_from_full` may observe a non-NULL return value and an uninitialized MonoImageOpenStatus, which may lead to incorrect diagnostics in code like:
```
MonoImageOpenStatus status;
MonoAssembly *assembly = mono_assembly_load_from_full (image, name, status, refonly);
if (!assembly || status != MONO_IMAGE_OK) {
fprintf(stderr, "Failure due to: %s\n", mono_image_strerror (status));
abort();
}
```
Which will print `Failure due to: Internal error`
Avoid an mmap that will fail since Android uses a custom loader and the assemblies aren't on disk
Co-authored-by: Aleksey Kliger <alklig@microsoft.com>1 parent 74f85c2 commit a102a35
2 files changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3171 | 3171 | | |
3172 | 3172 | | |
3173 | 3173 | | |
| 3174 | + | |
| 3175 | + | |
3174 | 3176 | | |
3175 | 3177 | | |
3176 | 3178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1067 | 1067 | | |
1068 | 1068 | | |
1069 | 1069 | | |
1070 | | - | |
| 1070 | + | |
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
| |||
0 commit comments