From 8ab309630b8c6c01745755a37b2cf130586f0087 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Fri, 18 Aug 2006 12:26:41 +0200 Subject: [PATCH] Keep old alloca() code around. --- src/stub/src/arch/i386/lzma_d.S | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/stub/src/arch/i386/lzma_d.S b/src/stub/src/arch/i386/lzma_d.S index 99d40868..40cc56e0 100644 --- a/src/stub/src/arch/i386/lzma_d.S +++ b/src/stub/src/arch/i386/lzma_d.S @@ -98,6 +98,8 @@ section LZMA_ELF00 mov ebx, -LZMA_LIT_SIZE shl ebx,cl +#if 1 +// alloca() via lea // CLzmaDecoderState:{*_bits, CProb[LZMA_BASE_SIZE + (LZMA_LIT_SIZE<<%cl)]} lea esp,[0 -4 - 2*LZMA_BASE_SIZE + 2*ebx + esp] and esp, (~0<<5) // 32-byte align @@ -105,6 +107,16 @@ section LZMA_ELF00 push 0 // inSizeProcessed push 0 // outSizeProcessed mov ebx,esp +#else +// alloca() via push 0 + // inSizeProcessed, outSizeProcessed, *_bits, CLzmaDecoderState + lea ebx,[0 -(2*4 +4) - 2*LZMA_BASE_SIZE + 2*ebx + esp] + and ebx, (~0<<5) // 32-byte align +.elf_clearstack1: + push 0 + cmp esp,ebx + jne .elf_clearstack1 +#endif push ebx // &outSizeProcessed add ebx, 4