Replace strtod() with builtin string to number conversion.

This commit is contained in:
Mike Pall
2012-08-25 23:02:29 +02:00
parent 653facd0d5
commit 4c882fe714
24 changed files with 660 additions and 272 deletions

View File

@@ -25,6 +25,7 @@
#endif
#include "lj_carith.h"
#include "lj_vm.h"
#include "lj_strscan.h"
/* Here's a short description how the FOLD engine processes instructions:
**
@@ -693,7 +694,7 @@ LJFOLD(STRTO KGC)
LJFOLDF(kfold_strto)
{
TValue n;
if (lj_str_tonum(ir_kstr(fleft), &n))
if (lj_strscan_num(ir_kstr(fleft), &n))
return lj_ir_knum(J, numV(&n));
return FAILFOLD;
}