Skip to content
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

[mono][wasm] Refactor mono_fixup_symbol_name #101681

Merged
merged 12 commits into from
May 9, 2024

Conversation

mkhamoyan
Copy link
Contributor

@mkhamoyan mkhamoyan commented Apr 29, 2024

This PR is a follow up for #101106

  • Refactor mono_fixup_symbol_name to handle properly leaking the memory
  • Apply same logic for all platforms

Copy link
Contributor

Tagging subscribers to this area:
See info in area-owners.md if you want to be subscribed.

@mkhamoyan mkhamoyan added the arch-wasm WebAssembly architecture label Apr 29, 2024
Copy link
Member

@lambdageek lambdageek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. important Don't return the address of a stack-allocated temporary.
  2. Avoid C standard string manipulation functions that don't take a buffer length (like strcpy). Consider using GString from eglib instead.
  3. Remove some of the duplicated logic about which characters are copied, which ones replaced by _ and which ones are encoded in hex.

src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
src/mono/mono/mini/aot-compiler.c Outdated Show resolved Hide resolved
src/mono/mono/mini/aot-compiler.c Outdated Show resolved Hide resolved
src/mono/mono/mini/mini-llvm.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
src/mono/mono/metadata/native-library.c Outdated Show resolved Hide resolved
@mkhamoyan mkhamoyan marked this pull request as ready for review May 6, 2024 15:23
@mkhamoyan mkhamoyan requested a review from thaystg as a code owner May 6, 2024 15:23
@mkhamoyan mkhamoyan requested a review from akoeplinger May 6, 2024 15:23
Copy link
Member

@akoeplinger akoeplinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One comment, LGTM otherwise

src/mono/mono/mini/aot-compiler.c Show resolved Hide resolved
@mkhamoyan mkhamoyan merged commit ce2364c into dotnet:main May 9, 2024
142 checks passed
@mkhamoyan mkhamoyan deleted the refactor_fixup_symbol_function branch May 9, 2024 11:30
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this pull request May 27, 2024
rolfbjarne added a commit to xamarin/xamarin-macios that referenced this pull request May 27, 2024
Ruihan-Yin pushed a commit to Ruihan-Yin/runtime that referenced this pull request May 30, 2024
Refactor mono_fixup_symbol_name, apply @lambdageek's feedback
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants