Skip to content

Conversation

@kripken
Copy link
Member

@kripken kripken commented Jul 15, 2024

flexibleCopy always visited parents before children, but it visited
vector children in reverse order:

(call        ;; 1
  (call $a)  ;; 3
  (call $b)  ;; 2
)

The order of children happened to not matter in any user of this code,
and that's just what you get when you iterate over children in a vector
and push them to a stack before visiting them, so this odd ordering
was not noticed.

For a new user I will introduce soon, however, it would be nice to have
the normal pre-order:

(call        ;; 1
  (call $a)  ;; 2
  (call $b)  ;; 3
)

(2 & 3 swapped).

This cannot be tested in the current code as it is NFC, but the later PR
will depend on it and test it heavily.

@kripken kripken requested a review from tlively July 15, 2024 23:34
@kripken kripken merged commit ee43476 into WebAssembly:main Jul 16, 2024
@kripken kripken deleted the copy-order branch July 16, 2024 18:26
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants