diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-07-16 11:26:56 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-07-16 11:26:56 -0300 |
| commit | e5146fb01f1ccb40c2663e745feffbf642cbf862 (patch) | |
| tree | 7015808b9b2bcd6c45f2042074459ce766fa0bd8 /lstate.h | |
| parent | ce6b930464edd621ec95ddab2ce9ccb7ddae605a (diff) | |
| download | lua-e5146fb01f1ccb40c2663e745feffbf642cbf862.tar.gz lua-e5146fb01f1ccb40c2663e745feffbf642cbf862.tar.bz2 lua-e5146fb01f1ccb40c2663e745feffbf642cbf862.zip | |
CallInfo has different fields for C functions and Lua functions
Diffstat (limited to 'lstate.h')
| -rw-r--r-- | lstate.h | 21 |
1 files changed, 15 insertions, 6 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstate.h,v 1.87 2002/07/08 18:21:33 roberto Exp roberto $ | 2 | ** $Id: lstate.h,v 1.88 2002/07/08 20:22:08 roberto Exp roberto $ |
| 3 | ** Global State | 3 | ** Global State |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -87,13 +87,22 @@ typedef struct stringtable { | |||
| 87 | */ | 87 | */ |
| 88 | typedef struct CallInfo { | 88 | typedef struct CallInfo { |
| 89 | StkId base; /* base for called function */ | 89 | StkId base; /* base for called function */ |
| 90 | const Instruction *savedpc; | 90 | StkId top; /* top for this function */ |
| 91 | StkId top; /* top for this function (when it's a Lua function) */ | 91 | const Instruction *savedpc; /* NULL means not a Lua function */ |
| 92 | const Instruction **pc; /* points to `pc' variable in `luaV_execute' */ | 92 | union { |
| 93 | StkId *pb; /* points to `base' variable in `luaV_execute' */ | 93 | struct { /* for Lua functions */ |
| 94 | int yield_results; | 94 | const Instruction **pc; /* points to `pc' variable in `luaV_execute' */ |
| 95 | StkId *pb; /* points to `base' variable in `luaV_execute' */ | ||
| 96 | } l; | ||
| 97 | struct { /* for C functions */ | ||
| 98 | int yield_results; | ||
| 99 | } c; | ||
| 100 | } u; | ||
| 95 | } CallInfo; | 101 | } CallInfo; |
| 96 | 102 | ||
| 103 | |||
| 104 | #define isLua(ci) ((ci)->savedpc != NULL) | ||
| 105 | |||
| 97 | #define ci_func(ci) (clvalue((ci)->base - 1)) | 106 | #define ci_func(ci) (clvalue((ci)->base - 1)) |
| 98 | 107 | ||
| 99 | 108 | ||
