aboutsummaryrefslogtreecommitdiff
path: root/src/lj_str.c
diff options
context:
space:
mode:
authorMike Pall <mike>2011-02-27 01:36:59 +0100
committerMike Pall <mike>2011-02-27 01:36:59 +0100
commitcead25f928ac606fc1a13882b818913aab3635a9 (patch)
tree92121b401f76f4b2891ebac0f710b0a921ce13b1 /src/lj_str.c
parentc031d4b6a06eab94e8d9b837ec6dc257899a4ae1 (diff)
downloadluajit-cead25f928ac606fc1a13882b818913aab3635a9.tar.gz
luajit-cead25f928ac606fc1a13882b818913aab3635a9.tar.bz2
luajit-cead25f928ac606fc1a13882b818913aab3635a9.zip
DUALNUM: Handle integer type in x86/x64 interpreter and libraries.
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: