Dibyendu Majumdar 9 years ago
parent c285473939
commit 69f2f16940

@ -421,6 +421,6 @@ LUAI_DDEC const lu_byte luaP_optypes[NUM_OPCODES]; /* opcode types */
#define RAVI_ENABLED 1
LUAI_FUNC const char* print_instruction(char *buf, size_t n, Instruction i);
LUAI_FUNC const char* raviP_instruction_to_str(char *buf, size_t n, Instruction i);
#endif

@ -586,7 +586,7 @@ static const char* PrintRaviCode(char *buf, size_t n, Instruction i) {
return buf;
}
const char* print_instruction(char *buf, size_t n, Instruction i) {
const char* raviP_instruction_to_str(char *buf, size_t n, Instruction i) {
OpCode o = GET_OPCODE(i);
if (o >= OP_RAVI_UNMF)
return PrintRaviCode(buf, n, i);

@ -117,23 +117,23 @@ static void print_expdesc(FILE *fp, FuncState *fs, const expdesc *e) {
break;
case VJMP:
fprintf(fp, "{p=%p, k=VJMP, pc=%d, instruction=(%s), type=%s}", e, e->u.info,
print_instruction(buf, sizeof buf, getcode(fs, e)),
raviP_instruction_to_str(buf, sizeof buf, getcode(fs, e)),
get_typename(e->ravi_type));
break;
case VRELOCABLE:
fprintf(fp, "{p=%p, k=VRELOCABLE, pc=%d, instruction=(%s), type=%s}", e, e->u.info,
print_instruction(buf, sizeof buf, getcode(fs, e)),
raviP_instruction_to_str(buf, sizeof buf, getcode(fs, e)),
get_typename(e->ravi_type));
break;
case VCALL:
fprintf(fp, "{p=%p, k=VCALL, pc=%d, instruction=(%s %s), type=%s}", e, e->u.info,
print_instruction(buf, sizeof buf, getcode(fs, e)),
raviP_instruction_to_str(buf, sizeof buf, getcode(fs, e)),
get_typename(raviY_get_register_typeinfo(fs, GETARG_A(getcode(fs, e)))),
get_typename(e->ravi_type));
break;
case VVARARG:
fprintf(fp, "{p=%p, k=VVARARG, pc=%d, instruction=(%s), type=%s}", e, e->u.info,
print_instruction(buf, sizeof buf, getcode(fs, e)),
raviP_instruction_to_str(buf, sizeof buf, getcode(fs, e)),
get_typename(e->ravi_type));
break;
}
@ -162,7 +162,7 @@ void raviY_printf(FuncState *fs, const char *format, ...)
else if (cp[0] == '%' && cp[1] == 'o') {
Instruction i;
i = va_arg(ap, Instruction);
print_instruction(buf, sizeof buf, i);
raviP_instruction_to_str(buf, sizeof buf, i);
fputs(buf, stdout);
cp++;
}

Loading…
Cancel
Save