diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-07-05 22:26:52 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-07-05 22:26:52 -0700 |
commit | 73e6b7fcbfdf075dc4dd1843d201aff20e875987 (patch) | |
tree | ae0a50fc2f6e7662f3c162b6a68a658d8e976fd6 /match.h | |
parent | 6024c4489837ad3813c6437a9576ab2072a184ed (diff) | |
download | txr-73e6b7fcbfdf075dc4dd1843d201aff20e875987.tar.gz txr-73e6b7fcbfdf075dc4dd1843d201aff20e875987.tar.bz2 txr-73e6b7fcbfdf075dc4dd1843d201aff20e875987.zip |
structs: get tests/012/stslot.tl to pass.
* struct.c (static_slot_rewrite_rec): A simple rearrangement:
switch to postorder traversal, doing the derived structs
first, then this struct. Why does this fix a bug? Because
when the assignment *s = *to occurs for the node at the root
of the recursion, s and from point to the same object. And
so the assignment alters from, which is the search key.
When the children are then processed, the search key doesn't
match anything: it now looks like the to slot that the
children are supposed to get, and so they don't have it, of
course. So in other words the slot being rewritten is not
found in the derived types and not rewritten there as it
should be.
Diffstat (limited to 'match.h')
0 files changed, 0 insertions, 0 deletions