diff options
author | jfrijters <jfrijters> | 2011-03-10 13:50:24 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2011-03-10 13:50:24 +0300 |
commit | 2989c70cadec193c948394ea424e2602088c27b3 (patch) | |
tree | 0cdafdd0837828969a7122259d09bd808bdeff6d /reflect/Emit | |
parent | d96b17bf88d64abddb22265623d9ba5d6dd618b4 (diff) |
Don't emit tiny header if max stack is set explicitly.
Diffstat (limited to 'reflect/Emit')
-rw-r--r-- | reflect/Emit/ILGenerator.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/reflect/Emit/ILGenerator.cs b/reflect/Emit/ILGenerator.cs index f7c58637..2f342ed1 100644 --- a/reflect/Emit/ILGenerator.cs +++ b/reflect/Emit/ILGenerator.cs @@ -130,6 +130,7 @@ namespace IKVM.Reflection.Emit private readonly List<ExceptionBlock> exceptions = new List<ExceptionBlock>(); private readonly Stack<ExceptionBlock> exceptionStack = new Stack<ExceptionBlock>(); private ushort maxStack; + private bool fatHeader; private int stackHeight; private Scope scope; private byte exceptionBlockAssistanceMode = EBAM_COMPAT; @@ -240,7 +241,11 @@ namespace IKVM.Reflection.Emit public int __MaxStackSize { get { return maxStack; } - set { maxStack = (ushort)value; } + set + { + maxStack = (ushort)value; + fatHeader = true; + } } // new in .NET 4.0 @@ -881,7 +886,7 @@ namespace IKVM.Reflection.Emit int localVarSigTok = 0; int rva; - if (locals.Count == 0 && exceptions.Count == 0 && maxStack <= 8 && code.Length < 64) + if (locals.Count == 0 && exceptions.Count == 0 && maxStack <= 8 && code.Length < 64 && !fatHeader) { rva = WriteTinyHeaderAndCode(bb); } |