diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib_ffi.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib_ffi.c b/src/lib_ffi.c index 5cb9086e..e0951c56 100644 --- a/src/lib_ffi.c +++ b/src/lib_ffi.c | |||
| @@ -112,10 +112,14 @@ static int ffi_index_meta(lua_State *L, CTState *cts, CType *ct, MMS mm) | |||
| 112 | const char *s; | 112 | const char *s; |
| 113 | err_index: | 113 | err_index: |
| 114 | s = strdata(lj_ctype_repr(L, id, NULL)); | 114 | s = strdata(lj_ctype_repr(L, id, NULL)); |
| 115 | if (tvisstr(L->base+1)) | 115 | if (tvisstr(L->base+1)) { |
| 116 | lj_err_callerv(L, LJ_ERR_FFI_BADMEMBER, s, strVdata(L->base+1)); | 116 | lj_err_callerv(L, LJ_ERR_FFI_BADMEMBER, s, strVdata(L->base+1)); |
| 117 | else | 117 | } else { |
| 118 | lj_err_callerv(L, LJ_ERR_FFI_BADIDX, s); | 118 | const char *key = tviscdata(L->base+1) ? |
| 119 | strdata(lj_ctype_repr(L, cdataV(L->base+1)->ctypeid, NULL)) : | ||
| 120 | lj_typename(L->base+1); | ||
| 121 | lj_err_callerv(L, LJ_ERR_FFI_BADIDXW, s, key); | ||
| 122 | } | ||
| 119 | } | 123 | } |
| 120 | if (!tvisfunc(tv)) { | 124 | if (!tvisfunc(tv)) { |
| 121 | if (mm == MM_index) { | 125 | if (mm == MM_index) { |
