[StackSwitching] Error properly on an unhandled resume during start - #8787
Conversation
| # Early output before any export was executed. Associate it with | ||
| # the start function if we can find it, otherwise the first named | ||
| # item as a fallback. | ||
| start_item = next((item for item in named_items if item[0] == 'start'), None) |
There was a problem hiding this comment.
Output lines cannot be reordered like this in general; filecheck won't know to skip around as it compares the actual output to the expectations.
There was a problem hiding this comment.
Can you explain the issue more? I'm not sure what the actual symptom is of the problem you describe. I verified the following:
- Auto-update changes nothing but what is in this PR.
- Lit tests pass.
- The interesting lit tests modified here both fail if I manually modify the new CHECK line.
And I'm not sure what else I can verify here 😄
There was a problem hiding this comment.
A test where this logic reorders the start function checks after the checks for some previous exported function should demonstrate the problem.
There was a problem hiding this comment.
Now I see, thanks. Ok, I removed the part attaching to start. Now it always attaches at the very front.
| # the first named item, so it appears before everything else | ||
| # (which is when it executes). | ||
| if named_items: | ||
| items.append((named_items[0], [line])) |
There was a problem hiding this comment.
Passing in all of the items just to get the first one seems overly complicated. Can we either use None as the sentinel for output not tied to an item or just pass in the first named item?
There was a problem hiding this comment.
Refactored to pass in the first named item.
| if named_items: | ||
| items.append((named_items[0], [line])) | ||
| else: | ||
| items.append((('module', 'trap'), [line])) |
There was a problem hiding this comment.
Or if this works, maybe we can just unconditionally do this? (Although using a separate sentinel like None to avoid the risk of collisions seems nicer.)
There was a problem hiding this comment.
This doens't work, but the opposite does. I made it unconditionally use the first named item.
Before, we asserted on stale state.
Fix the auto-updater script to not crash on such output (an exec
line before any function). That happens to improve one existing
test output.