aboutsummaryrefslogtreecommitdiff
path: root/src/lj_str.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_str.c')
-rw-r--r--src/lj_str.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lj_str.c b/src/lj_str.c
index dea02858..febe6fbf 100644
--- a/src/lj_str.c
+++ b/src/lj_str.c
@@ -187,7 +187,7 @@ int LJ_FASTCALL lj_str_tonumber(GCstr *str, TValue *n)
187int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n) 187int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n)
188{ 188{
189#if LJ_DUALNUM 189#if LJ_DUALNUM
190 int sign = 0; 190 int sign = 1;
191#else 191#else
192 lua_Number sign = 1; 192 lua_Number sign = 1;
193#endif 193#endif
@@ -216,7 +216,7 @@ int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n)
216 while (LJ_UNLIKELY(lj_char_isspace(*p))) p++; 216 while (LJ_UNLIKELY(lj_char_isspace(*p))) p++;
217 if (LJ_LIKELY(*p == '\0')) { 217 if (LJ_LIKELY(*p == '\0')) {
218#if LJ_DUALNUM 218#if LJ_DUALNUM
219 if (!sign) { 219 if (sign == 1) {
220 if (k < 0x80000000u) { 220 if (k < 0x80000000u) {
221 setintV(n, (int32_t)k); 221 setintV(n, (int32_t)k);
222 return 1; 222 return 1;
@@ -225,10 +225,9 @@ int LJ_FASTCALL lj_str_numconv(const char *s, TValue *n)
225 setintV(n, -(int32_t)k); 225 setintV(n, -(int32_t)k);
226 return 1; 226 return 1;
227 } 227 }
228#else 228#endif
229 setnumV(n, sign * (lua_Number)k); 229 setnumV(n, sign * (lua_Number)k);
230 return 1; 230 return 1;
231#endif
232 } 231 }
233 } 232 }
234parsedbl: 233parsedbl: