diff options
author | David Walter Seikel | 2012-02-04 19:11:16 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-02-04 19:11:16 +1000 |
commit | 8269cd00762a808ac73f18a02085cc77958d6e6d (patch) | |
tree | e054c2e7b31eb06489f9700f945411cd70f09009 /libraries | |
parent | Fix up "assignments in the middle of expressions is legal in LSL, but not in ... (diff) | |
download | SledjHamr-8269cd00762a808ac73f18a02085cc77958d6e6d.zip SledjHamr-8269cd00762a808ac73f18a02085cc77958d6e6d.tar.gz SledjHamr-8269cd00762a808ac73f18a02085cc77958d6e6d.tar.bz2 SledjHamr-8269cd00762a808ac73f18a02085cc77958d6e6d.tar.xz |
Apply LuaJIT hotfix1.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/luajit-2.0/README | 1 | ||||
-rw-r--r-- | libraries/luajit-2.0/src/lj_bcwrite.c | 32 | ||||
-rw-r--r-- | libraries/luajit-2.0/src/lj_lex.c | 13 |
3 files changed, 29 insertions, 17 deletions
diff --git a/libraries/luajit-2.0/README b/libraries/luajit-2.0/README index 271e312..7a5189b 100644 --- a/libraries/luajit-2.0/README +++ b/libraries/luajit-2.0/README | |||
@@ -1,4 +1,5 @@ | |||
1 | README for LuaJIT 2.0.0-beta9 | 1 | README for LuaJIT 2.0.0-beta9 |
2 | Patched with http://luajit.org/download/beta9_hotfix1.patch | ||
2 | ----------------------------- | 3 | ----------------------------- |
3 | 4 | ||
4 | LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. | 5 | LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. |
diff --git a/libraries/luajit-2.0/src/lj_bcwrite.c b/libraries/luajit-2.0/src/lj_bcwrite.c index de9b4cf..f177465 100644 --- a/libraries/luajit-2.0/src/lj_bcwrite.c +++ b/libraries/luajit-2.0/src/lj_bcwrite.c | |||
@@ -216,19 +216,27 @@ static void bcwrite_knum(BCWriteCtx *ctx, GCproto *pt) | |||
216 | /* Write a 33 bit ULEB128 for the int (lsb=0) or loword (lsb=1). */ | 216 | /* Write a 33 bit ULEB128 for the int (lsb=0) or loword (lsb=1). */ |
217 | if (!LJ_DUALNUM) { /* Narrow number constants to integers. */ | 217 | if (!LJ_DUALNUM) { /* Narrow number constants to integers. */ |
218 | lua_Number num = numV(o); | 218 | lua_Number num = numV(o); |
219 | k = lj_num2int(num); | 219 | |
220 | if (num == (lua_Number)k) { /* -0 is never a constant. */ | 220 | |
221 | save_int: | 221 | k = lj_num2int(num); |
222 | bcwrite_uleb128(ctx, 2*(uint32_t)k); | 222 | if (num == (lua_Number)k) { /* -0 is never a constant. */ |
223 | if (k < 0) ctx->sb.buf[ctx->sb.n-1] |= 0x10; | 223 | save_int: |
224 | continue; | 224 | bcwrite_uleb128(ctx, 2*(uint32_t)k | ((uint32_t)k & 0x80000000u)); |
225 | } | 225 | if (k < 0) { |
226 | } | 226 | char *p = &ctx->sb.buf[ctx->sb.n-1]; |
227 | bcwrite_uleb128(ctx, 1+2*o->u32.lo); | 227 | *p = (*p & 7) | ((k>>27) & 0x18); |
228 | if (o->u32.lo >= 0x80000000u) ctx->sb.buf[ctx->sb.n-1] |= 0x10; | 228 | } |
229 | bcwrite_uleb128(ctx, o->u32.hi); | 229 | continue; |
230 | } | 230 | } |
231 | } | 231 | } |
232 | bcwrite_uleb128(ctx, 1+(2*o->u32.lo | (o->u32.lo & 0x80000000u))); | ||
233 | if (o->u32.lo >= 0x80000000u) { | ||
234 | char *p = &ctx->sb.buf[ctx->sb.n-1]; | ||
235 | *p = (*p & 7) | ((o->u32.lo>>27) & 0x18); | ||
236 | } | ||
237 | bcwrite_uleb128(ctx, o->u32.hi); | ||
238 | } | ||
239 | } | ||
232 | } | 240 | } |
233 | 241 | ||
234 | /* Write bytecode instructions. */ | 242 | /* Write bytecode instructions. */ |
diff --git a/libraries/luajit-2.0/src/lj_lex.c b/libraries/luajit-2.0/src/lj_lex.c index 00daccd..59d8225 100644 --- a/libraries/luajit-2.0/src/lj_lex.c +++ b/libraries/luajit-2.0/src/lj_lex.c | |||
@@ -137,14 +137,17 @@ static int lex_number64(LexState *ls, TValue *tv) | |||
137 | /* Parse a number literal. */ | 137 | /* Parse a number literal. */ |
138 | static void lex_number(LexState *ls, TValue *tv) | 138 | static void lex_number(LexState *ls, TValue *tv) |
139 | { | 139 | { |
140 | int c; | 140 | int c, xp = 'E'; |
141 | lua_assert(lj_char_isdigit(ls->current)); | 141 | lua_assert(lj_char_isdigit(ls->current)); |
142 | do { | 142 | if ((c = ls->current) == '0') { |
143 | save_and_next(ls); | ||
144 | if ((ls->current & ~0x20) == 'X') xp = 'P'; | ||
145 | } | ||
146 | while (lj_char_isident(ls->current) || ls->current == '.' || | ||
147 | ((ls->current == '-' || ls->current == '+') && (c & ~0x20) == xp)) { | ||
143 | c = ls->current; | 148 | c = ls->current; |
144 | save_and_next(ls); | 149 | save_and_next(ls); |
145 | } while (lj_char_isident(ls->current) || ls->current == '.' || | 150 | } |
146 | ((ls->current == '-' || ls->current == '+') && | ||
147 | ((c & ~0x20) == 'E' || (c & ~0x20) == 'P'))); | ||
148 | #if LJ_HASFFI | 151 | #if LJ_HASFFI |
149 | c &= ~0x20; | 152 | c &= ~0x20; |
150 | if ((c == 'I' || c == 'L' || c == 'U') && !ctype_ctsG(G(ls->L))) | 153 | if ((c == 'I' || c == 'L' || c == 'U') && !ctype_ctsG(G(ls->L))) |