Maximum stack size may not fit in unsigned short

Therefore, fields ftransfer/ntransfer in lua_Debug must have type
'int'. (Maximum stack size must fit in an 'int'.) Also, this commit
adds check that maximum stack size respects size_t for size in bytes.
This commit is contained in:
Roberto Ierusalimschy
2024-07-16 11:33:30 -03:00
parent 6b45ccf4ed
commit cd4de92762
5 changed files with 46 additions and 28 deletions

4
lua.h
View File

@@ -503,8 +503,8 @@ struct lua_Debug {
unsigned char nparams;/* (u) number of parameters */
char isvararg; /* (u) */
char istailcall; /* (t) */
unsigned short ftransfer; /* (r) index of first value transferred */
unsigned short ntransfer; /* (r) number of transferred values */
int ftransfer; /* (r) index of first value transferred */
int ntransfer; /* (r) number of transferred values */
char short_src[LUA_IDSIZE]; /* (S) */
/* private part */
struct CallInfo *i_ci; /* active function */