From 3db3cc10ff141c6908edd589ef80b7ebb71cf147 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 20 Jan 2014 16:48:33 +0100 Subject: [PATCH 1/3] Fix compiler warnings. --- src/lib_string.c | 2 +- src/lj_cconv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_string.c b/src/lib_string.c index a02038e9..9ec6d0c3 100644 --- a/src/lib_string.c +++ b/src/lib_string.c @@ -64,7 +64,7 @@ LJLIB_ASM(string_byte) LJLIB_REC(string_range 0) LJLIB_ASM(string_char) { int i, nargs = (int)(L->top - L->base); - char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (size_t)nargs); + char *buf = lj_str_needbuf(L, &G(L)->tmpbuf, (MSize)nargs); for (i = 1; i <= nargs; i++) { int32_t k = lj_lib_checkint(L, i); if (!checku8(k)) diff --git a/src/lj_cconv.h b/src/lj_cconv.h index 9b96957c..17e0f050 100644 --- a/src/lj_cconv.h +++ b/src/lj_cconv.h @@ -29,7 +29,7 @@ static LJ_AINLINE uint32_t cconv_idx(CTInfo info) uint32_t idx = ((info >> 26) & 15u); /* Dispatch bits. */ lua_assert(ctype_type(info) <= CT_MAYCONVERT); #if LJ_64 - idx = ((U64x(f436fff5,fff7f021) >> 4*idx) & 15u); + idx = ((uint32_t)(U64x(f436fff5,fff7f021) >> 4*idx) & 15u); #else idx = (((idx < 8 ? 0xfff7f021u : 0xf436fff5) >> 4*(idx & 7u)) & 15u); #endif From dd910f0e010ff824dc4b2283f6ddbc0bfb06d79d Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 20 Jan 2014 16:49:13 +0100 Subject: [PATCH 2/3] Fix initial maxslot for down-recursive traces. --- src/lj_record.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lj_record.c b/src/lj_record.c index 60caf10d..f98b0a4c 100644 --- a/src/lj_record.c +++ b/src/lj_record.c @@ -2131,7 +2131,7 @@ static const BCIns *rec_setup_root(jit_State *J) case BC_RET0: case BC_RET1: /* No bytecode range check for down-recursive root traces. */ - J->maxslot = ra + bc_d(ins); + J->maxslot = ra + bc_d(ins) - 1; break; case BC_FUNCF: /* No bytecode range check for root traces started by a hot call. */ From 92475419e5cc5e61c5feb6a0fe549b1fc4a9d7cf Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Mon, 20 Jan 2014 16:56:37 +0100 Subject: [PATCH 3/3] Fix OSX build issue. --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 6b4c9f93..72bc912a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -294,7 +294,9 @@ ifeq (Darwin,$(TARGET_SYS)) endif TARGET_STRIP+= -x TARGET_AR+= 2>/dev/null - TARGET_XCFLAGS+= -fno-stack-protector + ifeq (,$(shell $(TARGET_CC) -o /dev/null -c -x c /dev/null -fno-stack-protector 2>/dev/null || echo 1)) + TARGET_XCFLAGS+= -fno-stack-protector + endif TARGET_XSHLDFLAGS= -dynamiclib -single_module -undefined dynamic_lookup -fPIC TARGET_DYNXLDOPTS= TARGET_XSHLDFLAGS+= -install_name $(TARGET_DYLIBPATH) -compatibility_version $(MAJVER).$(MINVER) -current_version $(MAJVER).$(MINVER).$(RELVER)