KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm writing a small IL-weaving application using Mono.Cecil, that requires me to manipulate the target assembly on an IL level. My question is quite simple, but I still find the matter very confusing. What is the practical difference between the ldfld and ldflda instructions? I have consulted with msdn, and it appears that while ldfld fetches the value of the field, ldflda gets the address of the field. Okay... but what does this mean? I first thought that the former is used for value types (and string), and the latter for reference types, but I have compiled a C# snippet and checked it in Reflector, and it proved me wrong. I haven't been able to find any distinct pattern in when the C# compiler emits ldflda instead of ldfld , and my searches didn't reveal any articles that would explain this. So when to use ldflda instead of ldfld ? Any help would be very much appreciated.
Tags (comma-separated)
Save Edits
Cancel