Repository navigation
Conversation
…dged as that extern (#806) fn_symbol_is_manual_extern and its value-ABI twin classified a call by its flat symbol: `extern_fn_names.contains(fn_sym)`. The Windows runtime declares Winsock's `extern fn accept` and `listen`, so a program's own `fn accept(g: &dyn Greet)` shared the symbol, manual_extern_requires_unsafe then read the program's own signature (get_sig) and found a reference parameter, and the call was "manual extern function call requires unsafe context" on Windows only (lldb: Sema.require_unsafe_operation from check_call, sig_idx the user's; a value parameter passed only because it needs no raw contract). A name is a manual extern now only when the declaration it resolves to is an extern's (extern_sig_modules). Test: test/behavior/behav_806_user_fn_named_like_platform_extern.w (`--target=windows_x86_64` refused it; it runs on win10 now).
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fn_symbol_is_manual_extern and its value-ABI twin classified a call by
its flat symbol:
extern_fn_names.contains(fn_sym). The Windows runtimedeclares Winsock's
extern fn acceptandlisten, so a program's ownfn accept(g: &dyn Greet)shared the symbol, manual_extern_requires_unsafethen read the program's own signature (get_sig) and found a reference
parameter, and the call was "manual extern function call requires unsafe
context" on Windows only (lldb: Sema.require_unsafe_operation from
check_call, sig_idx the user's; a value parameter passed only because it
needs no raw contract). A name is a manual extern now only when the
declaration it resolves to is an extern's (extern_sig_modules).
Test: test/behavior/behav_806_user_fn_named_like_platform_extern.w
(
--target=windows_x86_64refused it; it runs on win10 now).Closes #806