When generating assemblies using cecil, I manually specified .maxstack for MethodBody, but it is not reflected. It is always overwritten with the calculated result. This problem has been fixed in this PR.
Example:
var method = new MethodDefinition(...);
var body = method.Body;
body.MaxStackSize = 100;
// ...
module.Write("foo.dll");
I wasn't sure if the setter for the MaxStackSize property should check to see if the value has been changed, but I determined that the intention was to change it when the setter was called. How about this?
When generating assemblies using cecil, I manually specified
.maxstack
for MethodBody, but it is not reflected. It is always overwritten with the calculated result. This problem has been fixed in this PR.Example: