Tests like https://github.com/WebAssembly/spec/blob/master/test/core/memory.wast#L52 check that a memory with a size larger than 4 GiB get rejected by the validation, but the actual spec does not enforce that limit at either the validation of a module, a memory or a memtype.