Uh oh!
There was an error while loading. Please reload this page.
Fix SuperPMI assertion call in MethodContext::recGetHelperFtn() - #90778
Conversation
We can't use string concatenation in an argument to the `AssertCodeMsg` macro, so construct the string we want to print first.
ghost
commented
Aug 18, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsWe can't use string concatenation in an argument to the
|
BruceForstall
commented
Aug 18, 2023
@jakobbotsch PTAL |
BruceForstall
commented
Aug 18, 2023
Related: #90711 |
| // We can't use string concatenation in an argument to the `AssertCodeMsg` macro, so construct the string here. | ||
| char assertMsgBuff[200]; | ||
| sprintf_s(assertMsgBuff, sizeof(assertMsgBuff), "old: %016" PRIX64 " %016" PRIX64 ", new: %016" PRIX64 " %016" PRIX64, | ||
| oldValue.A, oldValue.B, value.A, value.B); | ||
| AssertCodeMsg(oldValue.A == value.A && oldValue.B == oldValue.B, EXCEPTIONCODE_MC, "collision! %s", assertMsgBuff); |
There was a problem hiding this comment.
I think we should just fix AssertCodeMsg like this:
- LogException(exCode, "SuperPMI assertion '%s' failed (" #msg ")", #expr, ##__VA_ARGS__);+ LogException(exCode, "SuperPMI assertion '%s' failed (" msg ")", #expr, ##__VA_ARGS__);Currently it is stringizing the format string, which is almost certainly not correct.
There was a problem hiding this comment.
Makes sense. Updated.
Maybe it should be just removed as in #90711 (comment) ? Presumably the same assert in many other JIT-EE functions will fail too (but they don't have it) |
BruceForstall
commented
Aug 18, 2023
Removing the assert in |
| AssertCodeMsg(oldValue.A == value.A && oldValue.B == oldValue.B, EXCEPTIONCODE_MC, | ||
| "collision! old: %016" PRIX64 " %016" PRIX64 ", new: %016" PRIX64 " %016" PRIX64 " \n", oldValue.A, oldValue.B, value.A, | ||
| "collision! old: %016" PRIX64 " %016" PRIX64 ", new: %016" PRIX64 " %016" PRIX64, oldValue.A, oldValue.B, value.A, |
There was a problem hiding this comment.
Asserts shouldn't have newlines in them
We can't use string concatenation in an argument to the
AssertCodeMsgmacro, so construct the string we want to print first.