diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-19 14:09:18 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-11-19 14:09:18 -0300 |
| commit | 50c7c915ee2fa239043d5456237f5145d064089b (patch) | |
| tree | 386e17e4baa154bb60dc54c1a00c751e3adedde9 /ldebug.c | |
| parent | b117bdb3448778d9e7f9a0302791e8ac3bb97ddd (diff) | |
| download | lua-50c7c915ee2fa239043d5456237f5145d064089b.tar.gz lua-50c7c915ee2fa239043d5456237f5145d064089b.tar.bz2 lua-50c7c915ee2fa239043d5456237f5145d064089b.zip | |
Debug information about extra arguments from __call
'debug.getinfo' can return number of extra arguments added to a call by
a chain of __call metavalues. That information is being used to improve
error messages about errors in these extra arguments.
Diffstat (limited to 'ldebug.c')
| -rw-r--r-- | ldebug.c | 10 |
1 files changed, 9 insertions, 1 deletions
| @@ -352,7 +352,15 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, | |||
| 352 | break; | 352 | break; |
| 353 | } | 353 | } |
| 354 | case 't': { | 354 | case 't': { |
| 355 | ar->istailcall = (ci != NULL && (ci->callstatus & CIST_TAIL)); | 355 | if (ci != NULL) { |
| 356 | ar->istailcall = !!(ci->callstatus & CIST_TAIL); | ||
| 357 | ar->extraargs = | ||
| 358 | cast_uchar((ci->callstatus & MAX_CCMT) >> CIST_CCMT); | ||
| 359 | } | ||
| 360 | else { | ||
| 361 | ar->istailcall = 0; | ||
| 362 | ar->extraargs = 0; | ||
| 363 | } | ||
| 356 | break; | 364 | break; |
| 357 | } | 365 | } |
| 358 | case 'n': { | 366 | case 'n': { |
