diff options
Diffstat (limited to 'src/lj_opt_fold.c')
-rw-r--r-- | src/lj_opt_fold.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index d8b6e884..e2ac28f2 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #endif | 28 | #endif |
29 | #include "lj_vm.h" | 29 | #include "lj_vm.h" |
30 | #include "lj_strscan.h" | 30 | #include "lj_strscan.h" |
31 | #include "lj_strfmt.h" | ||
31 | 32 | ||
32 | /* Here's a short description how the FOLD engine processes instructions: | 33 | /* Here's a short description how the FOLD engine processes instructions: |
33 | ** | 34 | ** |
@@ -809,15 +810,15 @@ LJFOLDF(kfold_conv_knum_u64_num) | |||
809 | LJFOLD(TOSTR KNUM any) | 810 | LJFOLD(TOSTR KNUM any) |
810 | LJFOLDF(kfold_tostr_knum) | 811 | LJFOLDF(kfold_tostr_knum) |
811 | { | 812 | { |
812 | return lj_ir_kstr(J, lj_str_fromnum(J->L, &knumleft)); | 813 | return lj_ir_kstr(J, lj_strfmt_num(J->L, ir_knum(fleft))); |
813 | } | 814 | } |
814 | 815 | ||
815 | LJFOLD(TOSTR KINT any) | 816 | LJFOLD(TOSTR KINT any) |
816 | LJFOLDF(kfold_tostr_kint) | 817 | LJFOLDF(kfold_tostr_kint) |
817 | { | 818 | { |
818 | return lj_ir_kstr(J, fins->op2 == IRTOSTR_INT ? | 819 | return lj_ir_kstr(J, fins->op2 == IRTOSTR_INT ? |
819 | lj_str_fromint(J->L, fleft->i) : | 820 | lj_strfmt_int(J->L, fleft->i) : |
820 | lj_str_fromchar(J->L, fleft->i)); | 821 | lj_strfmt_char(J->L, fleft->i)); |
821 | } | 822 | } |
822 | 823 | ||
823 | LJFOLD(STRTO KGC) | 824 | LJFOLD(STRTO KGC) |