-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Inline {enter,exit}_sync_call trampolines into sync-to-sync fused adapters
#13695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
74eccef
86e9432
e845a4f
c912ab0
531dfb4
ec50463
518ae3f
d17546c
89fe81d
af07b99
74776d3
a6cf08a
378790a
d5456ad
8ed6936
f9c23f1
87c74a8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1523,6 +1523,20 @@ impl Compiler { | |
| // succeed". Note that register restoration is part of the `try_call` | ||
| // and handler implementation. | ||
| builder.switch_to_block(exceptional_return); | ||
| if cfg!(feature = "component-model") && self.tunables().concurrency_support { | ||
| // NB: A trap unwinds over any fused adapter frames without running | ||
| // their `exit-sync-call`s. That can leave | ||
| // `VMStoreContext::current_thread` pointing at an old, invalid | ||
| // `VMDeferredThread` inside an old, since-unwound stack | ||
| // frame. Therefore, we must reset `current_thread` to avoid | ||
| // potential use-after-free bugs. | ||
| let forced = builder.ins().iconst(pointer_type, 1); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this "1" constant be moved to the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either that or could there be a compile-time assertion that "1" is the pattern used here, with a comment saying that if the constant changes it needs to update the compiler too? |
||
| alias_regions.store_vmstore_context_current_thread( | ||
| &mut builder.cursor(), | ||
| vm_store_ctx, | ||
| forced, | ||
| ); | ||
| } | ||
| let false_return = builder.ins().iconst(ir::types::I8, 0); | ||
| builder.ins().return_(&[false_return]); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.