So, I know that DYNAMICTOP_PTR is an internal detail and different when compiling different code or with different settings. But for now I just want to get a single program working so this is fine. I'm not in a browser context (using life VM) so I've set it to the value shown in the js generated for my WASM. However, when I compile with SAFE_HEAP=1 I always get a segfault (no segfault on same code running in the browser) -- inspecting the stack frame says to me that SAFE_HEAP_STORE_i32_4_2 got an argument that was greater than DYNAMICTOP_PTR and that's why it called segfault. Since the exact same WASM works in a web browser this says to me that my DYNAMICTOP_PTR must be wrong somehow? If I load the JS in browser and evaluate DYNAMICTOP_PTR in console the number is the same as what I am setting. It's my understanding that imported globals are immutable. Is there some other way the number gets changed before being sent in through the imports? I am compiling with these flags right now:
emcc -std=c99 -Wall --memory-init-file 0 -DEMSCRIPTEN -s EXPORTED_FUNCTIONS='["_run"]' -s MINIMAL_RUNTIME=0 -s SUPPORT_LONGJMP=0 -s RUNTIME_FUNCS_TO_IMPORT='[]' -s ASSERTIONS=2 -O0 -g -s SAFE_HEAP=1 -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
