-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix fat call transform for x86 #1451
Conversation
`AddArgumentToTail` with a null first argument will AV. I *think* this also works with methods that take a return buffer (methods that return large structs), but might require a pair of eyes more experienced in this codebase.
Could you please explain that to me? What is special about methods with a return buffer in the context of this change? |
The |
Got it, yes, I have checked that and it is correct, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
@@ -439,7 +439,14 @@ class IndirectCallTransformer | |||
fatCall->gtCallArgs = compiler->gtPrependNewCallArg(hiddenArgument, fatCall->gtCallArgs); | |||
} | |||
#else | |||
AddArgumentToTail(fatCall->gtCallArgs, hiddenArgument); | |||
if (fatCall->gtCallArgs == nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this check actually be in AddArgumentToTail
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would have to change the signature of the method and either pass fatCall->gtCallArgs
by reference or have it return a Use*
that we can assign. Doable, but I already merged this and I really dislike dealing with the JIT code formatter (which I'm sure would moan about something).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MichalStrehovsky if you use jitutils then jit code formatting is pretty simple
- clone jitutils repo
- run
bootstrap.cmd
from repo root - cd to your runtime repo
- run
jit-format --fix --untidy --runtime src\coreclr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndyAyersMS thanks! I'm bookmarking your comment
AddArgumentToTail
with a null first argument will AV.I think this also works with methods that take a return buffer (methods that return large structs), but might require a pair of eyes more experienced in this codebase.