Hey, it appears it's something wrong with allocators in the unordered_map resulting code. I tried to change to std::map, but the error comes even sooner and happens at the second allocation - at least this gives a hint it's in the allocation and not in the hashing? I step on the Webassembly code in the chrome dev tools but was going nowhere reading the source from the STL.
:std::__2::pair<std::__2::__hash_iterator<std::__2::__hash_node<std::__2::__hash_value_type<unsigned\20long\2c\20int>\2c\20void*>*>\2c\20bool>\20std::__2::__hash_table<std::__2::__hash_value_type<unsigned\20long\2c\20int>\2c\20std::__2::__unordered_map_hasher<unsigned\20long\2c\20std::__2::__hash_value_type<unsigned\20long\2c\20int>\2c\20std::__2::hash<unsigned\20long>\2c\20true>\2c\20std::__2::__unordered_map_equal<unsigned\20long\2c\20std::__2::__hash_value_type<unsigned\20long\2c\20int>\2c\20std::__2::equal_to<unsigned\20long>\2c\20true>\2c\20std::__2::allocator<std::__2::__hash_value_type<unsigned\20long\2c\20int>\20>\20>::__insert_unique<std::__2::pair<unsigned\20long\2c\20int>&\2c\20void>\28std::__2::pair<unsigned\20long\2c\20int>&\29
For now I replaced this with a simple for that iterates in the array of object until it finds the corresponding address and it's working.
I also tried to turn on EMULATE_FUNCTION_POINTER_CASTS but this gave me an error message in the console at the module initialization saying it could not convert 1 to BigInt , I then tried to disable WASM_BIGINT but it didn't work. Function pointer casts are necessary for the plugin interface in the code so it would be cool to get them, otherwise I need to figure a way to rewrite that part of the engine - but this should be ok for now.
I do still have some problems (threaded sounds and a blocking while) but I think I can solve them with SDL threads and asincfy, or other approaches, those are fine and can easily be solved once I have more time.
Anyway, it's pretty amazing seeing a simple game bootup and run in the browser, great work people.