runtime: vmoffsets must be checked in reverse order (#4253)

When adding shared memory, memories owned by the module were added to a
`owned_memories` array placed immediately after the `defined_memories`
array. When checking the size of each array with `region_sizes`, the
size of `defined_memories` and `owned_memories` were checked in this
order. But `region_sizes` is iterating through the fields in the reverse
order. This change reverses the field order to fix the associated fuzz
bug.
This commit is contained in:
Andrew Brown
2022-06-09 17:53:11 -07:00
committed by GitHub
parent 72c6b79e9c
commit 0dcda643ea

View File

@@ -251,8 +251,8 @@ impl<P: PtrSize> VMOffsets<P> {
calculate_sizes! {
defined_anyfuncs: "module functions",
defined_globals: "defined globals",
defined_memories: "defined memories",
owned_memories: "owned memories",
defined_memories: "defined memories",
defined_tables: "defined tables",
imported_globals: "imported globals",
imported_memories: "imported memories",