I am writing a small IL-weaving application using Mono.Cecil that requires me to manipulate the target assembly at the IL level.
My question is pretty simple, but I still find this question very confusing. What is the practical difference between the ldfld and ldflda ?
I consulted with msdn and it seems that while ldfld selects the field value, ldflda gets the address of the field. Ok ... but what does that mean? At first I thought that the first is used for value types (and strings), and the second for reference types, but I compiled a C # fragment and checked it in Reflector, and this turned out to be wrong to me.
I was unable to find any single template when the C # compiler emits ldflda instead of ldfld , and my searches did not reveal any articles that could explain this. So when to use ldflda instead of ldfld ?
Any help would be greatly appreciated.
Shdnx
source share