Use explicit conversion type for IR_TOSTR. Add char conversion.

This commit is contained in:
Mike Pall
2013-04-23 02:20:03 +02:00
parent 557391c3b7
commit 255326afb6
10 changed files with 47 additions and 20 deletions

View File

@@ -335,7 +335,8 @@ static void LJ_FASTCALL recff_tostring(jit_State *J, RecordFFData *rd)
/* Pass on result in J->base[0]. */
} else if (!recff_metacall(J, rd, MM_tostring)) {
if (tref_isnumber(tr)) {
J->base[0] = emitir(IRT(IR_TOSTR, IRT_STR), tr, 0);
J->base[0] = emitir(IRT(IR_TOSTR, IRT_STR), tr,
tref_isnum(tr) ? IRTOSTR_NUM : IRTOSTR_INT);
} else if (tref_ispri(tr)) {
J->base[0] = lj_ir_kstr(J, strV(&J->fn->c.upvalue[tref_type(tr)]));
} else {