-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasi-libc: compile emmalloc.c without strict aliasing (#16157)
emmalloc.c does a fair amount of type punning in order to access the size of memory regions and traverse them. Unfortunately, that can lead to unwanted optimizations. This simple test case currently triggers a memory fault: int main(void) { char * volatile p = malloc(1); p = realloc(p, 12); p = malloc(1); printf("%p\n", p); } Work around this by adding "-fno-strict-aliasing" when compiling that file.
- Loading branch information
Showing
1 changed file
with
21 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters