Changes for issue #10595. Handle assembly references through alias in the correct way.#10878
Changes for issue #10595. Handle assembly references through alias in the correct way.#10878rartemev wants to merge 3 commits into
Conversation
|
@mletterle @RussKeldorph Please review |
|
@dotnet-bot test |
|
I like it! Looks good to me. |
|
@dotnet/jit-contrib |
| } | ||
| else // needs to be resolved | ||
| if(!m_fIsMscorlib) tkResScope = GetBaseAsmRef(); | ||
| else { // needs to be resolved |
There was a problem hiding this comment.
Please match bracing style (opening { on next line). Applies to next line as well.
de5ce37 to
2bbeec1
Compare
| if(!m_fIsMscorlib) tkResScope = GetBaseAsmRef(); | ||
| else | ||
| { // needs to be resolved | ||
| if (TypeFromToken(tkResScope) == mdtAssemblyRef && RidFromToken(tkResScope) > 0) |
There was a problem hiding this comment.
Should the second && subexpression be !IsNilToken(tkResScope)? Inverse below.
| if (TypeFromToken(tkResScope) == mdtAssemblyRef && RidFromToken(tkResScope) > 0) | ||
| { | ||
| // considering the aliased case '[' dottedName ']' slashedName | ||
| AsmManAssembly* assembly = m_pManifest->m_AsmRefLst.PEEK(RidFromToken(tkResScope) - 1); |
There was a problem hiding this comment.
I'm sorry I'm not terribly familiar with ILAsm, so please forgive me if these are naive questions:
- Is the RID guaranteed to be in m_AsmRefLst, i.e. do you need to check the return value of PEEK before passing it to GetAsmRef?
- Is it possible to have multiple indirections through aliasing such that you might need to iterate until you find the non-alias?
There was a problem hiding this comment.
- Sure, the first condition "TypeFromToken(tkResScope) == mdtAssemblyRef" guarantees this fact.
- I do not know. I am not familiar with ILAsm either. If there is someone who knows please help us.
There was a problem hiding this comment.
Regarding #2, can you attempt to construct a case with multiple levels of aliases and see what you get? If the syntax doesn't allow you to create an alias of SomethingElse (from original repro code), then I think you may be ok and this change looks good to me.
876e998 to
1bd8b36
Compare
|
@dotnet-bot test Tizen armel Cross Debug Build (biuld break) |
331c11d to
1609ac5
Compare
| if(!m_fIsMscorlib) tkResScope = GetBaseAsmRef(); | ||
| else | ||
| { // needs to be resolved | ||
| if ((TypeFromToken(tkResScope) == mdtAssemblyRef) && !IsNilToken(tkResScope)) |
There was a problem hiding this comment.
Ok, great. Two more things:
- please match the prevailing style of the file where there is no space between
if/whileand following(. I hate this style, but it's important to match it. We should probably add these ilasm and ildasm to the list of things covered byjit-format, but that's for another change. - please add a regression test somewhere under
tests\src\JIT\Regression(unless you can find a better place). You should be able to copy another.iltest and paste your source into it.
There was a problem hiding this comment.
- Fixed
- Added regression test into tests\src\Regression\coreclr
1609ac5 to
f83f353
Compare
|
@dotnet-bot test Tizen armel Cross Release Build |
|
@dotnet-bot test Windows_NT x64 Debug Build and Test |
751c0d8 to
2dd50f9
Compare
2dd50f9 to
d78a14c
Compare
Changes for issue #10595. Handle assembly references through alias in the correct way.
ildasm output for sample from issue description.