diff options
author | Mike Pall <mike> | 2010-03-09 19:03:43 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-03-09 19:03:43 +0100 |
commit | c56d791316c0bd4d6122a40eb416423f0deea796 (patch) | |
tree | 767844767023a4bee083ddf87a40acd29227e317 /src/lj_record.c | |
parent | f49649d0055556ecf74d2b58bb4b819ed0ab900d (diff) | |
download | luajit-c56d791316c0bd4d6122a40eb416423f0deea796.tar.gz luajit-c56d791316c0bd4d6122a40eb416423f0deea796.tar.bz2 luajit-c56d791316c0bd4d6122a40eb416423f0deea796.zip |
Fix handling of bad argument types in recorder.
Diffstat (limited to 'src/lj_record.c')
-rw-r--r-- | src/lj_record.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c index fa4180b9..44cb7317 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1091,7 +1091,7 @@ typedef void (LJ_FASTCALL *RecordFunc)(jit_State *J, RecordFFData *rd); | |||
1091 | /* Get runtime value of int argument. */ | 1091 | /* Get runtime value of int argument. */ |
1092 | static int32_t argv2int(jit_State *J, TValue *o) | 1092 | static int32_t argv2int(jit_State *J, TValue *o) |
1093 | { | 1093 | { |
1094 | if (tvisstr(o) && !lj_str_tonum(strV(o), o)) | 1094 | if (!tvisnum(o) && !(tvisstr(o) && lj_str_tonum(strV(o), o))) |
1095 | lj_trace_err(J, LJ_TRERR_BADTYPE); | 1095 | lj_trace_err(J, LJ_TRERR_BADTYPE); |
1096 | return lj_num2bit(numV(o)); | 1096 | return lj_num2bit(numV(o)); |
1097 | } | 1097 | } |
@@ -1103,7 +1103,8 @@ static GCstr *argv2str(jit_State *J, TValue *o) | |||
1103 | return strV(o); | 1103 | return strV(o); |
1104 | } else { | 1104 | } else { |
1105 | GCstr *s; | 1105 | GCstr *s; |
1106 | lua_assert(tvisnum(o)); | 1106 | if (!tvisnum(o)) |
1107 | lj_trace_err(J, LJ_TRERR_BADTYPE); | ||
1107 | s = lj_str_fromnum(J->L, &o->n); | 1108 | s = lj_str_fromnum(J->L, &o->n); |
1108 | setstrV(J->L, o, s); | 1109 | setstrV(J->L, o, s); |
1109 | return s; | 1110 | return s; |