When running the following C code, I get different values for the address of var each time, which is what one would expect.
int main()
{
int var = 5;
printf("var: %d\n", var);
printf("address of var: %p\n", &var);
printf("address of var: %d\n", &var);
return 0;
}
However if I convert the C to wasm using emsciption and run it, the value for the memory address is the same each time. Does web-assembly hard code memory address?
I've tried reading up on it but have not found a straight forward answer, https://www.cs.uaf.edu/courses/cs301/2014-fall/notes/memory/, https://ariya.io/2019/05/basics-of-memory-access-in-webassembly