Skip to content

Commit

Permalink
lib/decompress_bunzip2.c: fix checkstack warning
Browse files Browse the repository at this point in the history
Fix checkstack error:

lib/decompress_bunzip2.c: In function `get_next_block':
lib/decompress_bunzip2.c:511: warning: the frame size of 1932 bytes is larger than 1024 bytes

byteCount, symToByte, and mtfSymbol cannot be declared static or allocated
dynamically so place them in the bunzip_data struct.

Signed-off-by: Prarit Bhargava <[email protected]>
Cc: Phillip Lougher <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
prarit authored and torvalds committed Aug 11, 2010
1 parent 5bf2b19 commit dd21e9b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/decompress_bunzip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ struct bunzip_data {
unsigned char selectors[32768]; /* nSelectors = 15 bits */
struct group_data groups[MAX_GROUPS]; /* Huffman coding tables */
int io_error; /* non-zero if we have IO error */
int byteCount[256];
unsigned char symToByte[256], mtfSymbol[256];
};


Expand Down Expand Up @@ -158,14 +160,16 @@ static int INIT get_next_block(struct bunzip_data *bd)
int *base = NULL;
int *limit = NULL;
int dbufCount, nextSym, dbufSize, groupCount, selector,
i, j, k, t, runPos, symCount, symTotal, nSelectors,
byteCount[256];
unsigned char uc, symToByte[256], mtfSymbol[256], *selectors;
i, j, k, t, runPos, symCount, symTotal, nSelectors, *byteCount;
unsigned char uc, *symToByte, *mtfSymbol, *selectors;
unsigned int *dbuf, origPtr;

dbuf = bd->dbuf;
dbufSize = bd->dbufSize;
selectors = bd->selectors;
byteCount = bd->byteCount;
symToByte = bd->symToByte;
mtfSymbol = bd->mtfSymbol;

/* Read in header signature and CRC, then validate signature.
(last block signature means CRC is for whole file, return now) */
Expand Down

0 comments on commit dd21e9b

Please sign in to comment.