diff options
author | Mike Pall <mike> | 2011-04-19 17:12:41 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-04-19 17:12:41 +0200 |
commit | 9ea679410c8061741a49350b3fc969365ffe5547 (patch) | |
tree | ffdee260d58659979e00327bea8c6585355a6cce | |
parent | e94a12f4f6dcb1f34b986c745d78b380aca91750 (diff) | |
download | luajit-9ea679410c8061741a49350b3fc969365ffe5547.tar.gz luajit-9ea679410c8061741a49350b3fc969365ffe5547.tar.bz2 luajit-9ea679410c8061741a49350b3fc969365ffe5547.zip |
Workaround to compile with Clang. Fix Clang warnings.
-rw-r--r-- | src/lj_err.c | 5 | ||||
-rw-r--r-- | src/lj_record.c | 4 | ||||
-rw-r--r-- | src/lj_tab.c | 10 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/lj_err.c b/src/lj_err.c index 51c8fb9f..7eaffdb6 100644 --- a/src/lj_err.c +++ b/src/lj_err.c | |||
@@ -533,6 +533,11 @@ static void *err_unwind(lua_State *L, void *stopcf, int errcode) | |||
533 | 533 | ||
534 | #if defined(__GNUC__) && !LJ_TARGET_ARM | 534 | #if defined(__GNUC__) && !LJ_TARGET_ARM |
535 | 535 | ||
536 | #ifdef __clang__ | ||
537 | /* http://llvm.org/bugs/show_bug.cgi?id=8703 */ | ||
538 | #define __unwind_word__ word | ||
539 | #endif | ||
540 | |||
536 | #include <unwind.h> | 541 | #include <unwind.h> |
537 | 542 | ||
538 | #define LJ_UEXCLASS 0x4c55414a49543200ULL /* LUAJIT2\0 */ | 543 | #define LJ_UEXCLASS 0x4c55414a49543200ULL /* LUAJIT2\0 */ |
diff --git a/src/lj_record.c b/src/lj_record.c index dc0eea41..36425086 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -556,7 +556,7 @@ static void rec_call_setup(jit_State *J, BCReg func, ptrdiff_t nargs) | |||
556 | TRef trfunc, *fbase = &J->base[func]; | 556 | TRef trfunc, *fbase = &J->base[func]; |
557 | ptrdiff_t i; | 557 | ptrdiff_t i; |
558 | for (i = 0; i <= nargs; i++) | 558 | for (i = 0; i <= nargs; i++) |
559 | getslot(J, func+i); /* Ensure func and all args have a reference. */ | 559 | (void)getslot(J, func+i); /* Ensure func and all args have a reference. */ |
560 | if (!tref_isfunc(fbase[0])) { /* Resolve __call metamethod. */ | 560 | if (!tref_isfunc(fbase[0])) { /* Resolve __call metamethod. */ |
561 | ix.tab = fbase[0]; | 561 | ix.tab = fbase[0]; |
562 | copyTV(J->L, &ix.tabv, functv); | 562 | copyTV(J->L, &ix.tabv, functv); |
@@ -634,7 +634,7 @@ void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults) | |||
634 | TValue *frame = J->L->base - 1; | 634 | TValue *frame = J->L->base - 1; |
635 | ptrdiff_t i; | 635 | ptrdiff_t i; |
636 | for (i = 0; i < gotresults; i++) | 636 | for (i = 0; i < gotresults; i++) |
637 | getslot(J, rbase+i); /* Ensure all results have a reference. */ | 637 | (void)getslot(J, rbase+i); /* Ensure all results have a reference. */ |
638 | while (frame_ispcall(frame)) { /* Immediately resolve pcall() returns. */ | 638 | while (frame_ispcall(frame)) { /* Immediately resolve pcall() returns. */ |
639 | BCReg cbase = (BCReg)frame_delta(frame); | 639 | BCReg cbase = (BCReg)frame_delta(frame); |
640 | if (--J->framedepth < 0) | 640 | if (--J->framedepth < 0) |
diff --git a/src/lj_tab.c b/src/lj_tab.c index 830e3023..cd200f02 100644 --- a/src/lj_tab.c +++ b/src/lj_tab.c | |||
@@ -97,7 +97,7 @@ static GCtab *newtab(lua_State *L, uint32_t asize, uint32_t hbits) | |||
97 | { | 97 | { |
98 | GCtab *t; | 98 | GCtab *t; |
99 | /* First try to colocate the array part. */ | 99 | /* First try to colocate the array part. */ |
100 | if (LJ_MAX_COLOSIZE && asize > 0 && asize <= LJ_MAX_COLOSIZE) { | 100 | if (LJ_MAX_COLOSIZE != 0 && asize > 0 && asize <= LJ_MAX_COLOSIZE) { |
101 | lua_assert((sizeof(GCtab) & 7) == 0); | 101 | lua_assert((sizeof(GCtab) & 7) == 0); |
102 | t = (GCtab *)lj_mem_newgco(L, sizetabcolo(asize)); | 102 | t = (GCtab *)lj_mem_newgco(L, sizetabcolo(asize)); |
103 | t->gct = ~LJ_TTAB; | 103 | t->gct = ~LJ_TTAB; |
@@ -203,9 +203,9 @@ void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t) | |||
203 | { | 203 | { |
204 | if (t->hmask > 0) | 204 | if (t->hmask > 0) |
205 | lj_mem_freevec(g, noderef(t->node), t->hmask+1, Node); | 205 | lj_mem_freevec(g, noderef(t->node), t->hmask+1, Node); |
206 | if (t->asize > 0 && LJ_MAX_COLOSIZE && t->colo <= 0) | 206 | if (t->asize > 0 && LJ_MAX_COLOSIZE != 0 && t->colo <= 0) |
207 | lj_mem_freevec(g, tvref(t->array), t->asize, TValue); | 207 | lj_mem_freevec(g, tvref(t->array), t->asize, TValue); |
208 | if (LJ_MAX_COLOSIZE && t->colo) | 208 | if (LJ_MAX_COLOSIZE != 0 && t->colo) |
209 | lj_mem_free(g, t, sizetabcolo((uint32_t)t->colo & 0x7f)); | 209 | lj_mem_free(g, t, sizetabcolo((uint32_t)t->colo & 0x7f)); |
210 | else | 210 | else |
211 | lj_mem_freet(g, t); | 211 | lj_mem_freet(g, t); |
@@ -224,7 +224,7 @@ static void resizetab(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits) | |||
224 | uint32_t i; | 224 | uint32_t i; |
225 | if (asize > LJ_MAX_ASIZE) | 225 | if (asize > LJ_MAX_ASIZE) |
226 | lj_err_msg(L, LJ_ERR_TABOV); | 226 | lj_err_msg(L, LJ_ERR_TABOV); |
227 | if (LJ_MAX_COLOSIZE && t->colo > 0) { | 227 | if (LJ_MAX_COLOSIZE != 0 && t->colo > 0) { |
228 | /* A colocated array must be separated and copied. */ | 228 | /* A colocated array must be separated and copied. */ |
229 | TValue *oarray = tvref(t->array); | 229 | TValue *oarray = tvref(t->array); |
230 | array = lj_mem_newvec(L, asize, TValue); | 230 | array = lj_mem_newvec(L, asize, TValue); |
@@ -257,7 +257,7 @@ static void resizetab(lua_State *L, GCtab *t, uint32_t asize, uint32_t hbits) | |||
257 | if (!tvisnil(&array[i])) | 257 | if (!tvisnil(&array[i])) |
258 | copyTV(L, lj_tab_setinth(L, t, (int32_t)i), &array[i]); | 258 | copyTV(L, lj_tab_setinth(L, t, (int32_t)i), &array[i]); |
259 | /* Physically shrink only separated arrays. */ | 259 | /* Physically shrink only separated arrays. */ |
260 | if (LJ_MAX_COLOSIZE && t->colo <= 0) | 260 | if (LJ_MAX_COLOSIZE != 0 && t->colo <= 0) |
261 | setmref(t->array, lj_mem_realloc(L, array, | 261 | setmref(t->array, lj_mem_realloc(L, array, |
262 | oldasize*sizeof(TValue), asize*sizeof(TValue))); | 262 | oldasize*sizeof(TValue), asize*sizeof(TValue))); |
263 | } | 263 | } |