[wasm] Handle Top-Level style entry point mangling too#47405
[wasm] Handle Top-Level style entry point mangling too#47405lewing merged 5 commits intodotnet:masterfrom
Conversation
This adds a check for '<Main>$' in addition to 'Main' when looking for the async entry point. Fixes dotnet#47404
|
Tagging subscribers to this area: @CoffeeFlux Issue DetailsThis adds a check for ' $' in addition to 'Main' whenlooking for the async entry point. Fixes #47404
|
| } | ||
|
|
||
| // look for "Name" by trimming the first and last character of "<Name>" | ||
| async_name [name_length - 1] = '\0'; |
There was a problem hiding this comment.
This will zero out the $, but you also need to zero out the >.
There was a problem hiding this comment.
Read it closer. async_name[name_length - 1] == > not $ because the length wasn't incremented
There was a problem hiding this comment.
Ah right, because you aren't null-terminating it and you end up with <Name\0$. I still think you should include the null terminator and zero out both characters.
There was a problem hiding this comment.
The buffer was definitely too short, switched to snprintf here (and in another place) to fix termination (and not overwrite memory). I don't see a need to null out the $ it is harmless.
CoffeeFlux
left a comment
There was a problem hiding this comment.
Other than this and zeroing both characters, LGTM with the test. Thanks!
| return args.Length; | ||
| } | ||
| } No newline at end of file | ||
| return args.Length; No newline at end of file |
There was a problem hiding this comment.
Was it intended to switch this to a top level program? If so, we should get rid of the indentation.
There was a problem hiding this comment.
no this was damage. reverting
This adds a check for '<Main>$' in addition to 'Main' when
looking for the async entry point.
Fixes #47404