summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Bickel <mabi@gentoo.org>2008-05-15 11:35:17 +0000
committerMatti Bickel <mabi@gentoo.org>2008-05-15 11:35:17 +0000
commit2e46ca33c80e5492683fdd64d813455c216c350a (patch)
tree2bb72fd416d805413465869fc5e07caaab08c21d /dev-lang
parentRemoved net-wireless/rt2x00 wrt bug 207697. (diff)
downloadgentoo-2-2e46ca33c80e5492683fdd64d813455c216c350a.tar.gz
gentoo-2-2e46ca33c80e5492683fdd64d813455c216c350a.tar.bz2
gentoo-2-2e46ca33c80e5492683fdd64d813455c216c350a.zip
bump including some serious crash fixes
(Portage version: 2.1.5_rc10)
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/lua/ChangeLog11
-rw-r--r--dev-lang/lua/files/5.1.3/05_validator.upstream.patch44
-rw-r--r--dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch21
-rw-r--r--dev-lang/lua/files/5.1.3/07_validator2.upstream.patch25
-rw-r--r--dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch12
-rw-r--r--dev-lang/lua/lua-5.1.3-r2.ebuild109
6 files changed, 221 insertions, 1 deletions
diff --git a/dev-lang/lua/ChangeLog b/dev-lang/lua/ChangeLog
index ee9d7e53f043..6f2bf6ac87b7 100644
--- a/dev-lang/lua/ChangeLog
+++ b/dev-lang/lua/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for dev-lang/lua
# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.98 2008/02/21 20:38:22 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/ChangeLog,v 1.99 2008/05/15 11:35:16 mabi Exp $
+
+*lua-5.1.3-r2 (15 May 2008)
+
+ 15 May 2008; Matti Bickel <mabi@gentoo.org>
+ +files/5.1.3/05_validator.upstream.patch,
+ +files/5.1.3/06_c_stack.upstream.patch,
+ +files/5.1.3/07_validator2.upstream.patch,
+ +files/5.1.3/08_code_injection.upstream.patch, +lua-5.1.3-r2.ebuild:
+ bump including some serious crash fixes. see http://www.lua.org/bugs.html
21 Feb 2008; Jeroen Roovers <jer@gentoo.org> lua-5.1.2-r2.ebuild:
Stable for HPPA (bug #210517).
diff --git a/dev-lang/lua/files/5.1.3/05_validator.upstream.patch b/dev-lang/lua/files/5.1.3/05_validator.upstream.patch
new file mode 100644
index 000000000000..3a32d06eac23
--- /dev/null
+++ b/dev-lang/lua/files/5.1.3/05_validator.upstream.patch
@@ -0,0 +1,44 @@
+diff -rdu lua-5.1.3.orig/src/ldebug.c lua-5.1.3/src/ldebug.c
+--- lua-5.1.3.orig/src/ldebug.c 2008-02-12 16:17:59.000000000 +0000
++++ lua-5.1.3/src/ldebug.c 2008-02-12 16:26:32.000000000 +0000
+@@ -275,12 +275,12 @@
+
+ static int precheck (const Proto *pt) {
+ check(pt->maxstacksize <= MAXSTACK);
+- lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
+- lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) ||
++ check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
++ check(!(pt->is_vararg & VARARG_NEEDSARG) ||
+ (pt->is_vararg & VARARG_HASARG));
+ check(pt->sizeupvalues <= pt->nups);
+ check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
+- check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
++ check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
+ return 1;
+ }
+
+@@ -363,7 +363,11 @@
+ }
+ switch (op) {
+ case OP_LOADBOOL: {
+- check(c == 0 || pc+2 < pt->sizecode); /* check its jump */
++ if (c == 1) { /* does it jump? */
++ check(pc+2 < pt->sizecode); /* check its jump */
++ check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST ||
++ GETARG_C(pt->code[pc+1]) != 0);
++ }
+ break;
+ }
+ case OP_LOADNIL: {
+@@ -428,7 +432,10 @@
+ }
+ case OP_SETLIST: {
+ if (b > 0) checkreg(pt, a + b);
+- if (c == 0) pc++;
++ if (c == 0) {
++ pc++;
++ check(pc < pt->sizecode - 1);
++ }
+ break;
+ }
+ case OP_CLOSURE: {
diff --git a/dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch b/dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch
new file mode 100644
index 000000000000..746acbf58972
--- /dev/null
+++ b/dev-lang/lua/files/5.1.3/06_c_stack.upstream.patch
@@ -0,0 +1,21 @@
+diff -rdu lua-5.1.3.orig/src/lundump.c lua-5.1.3/src/lundump.c
+--- lua-5.1.3.orig/src/lundump.c 2008-02-12 16:17:59.000000000 +0000
++++ lua-5.1.3/src/lundump.c 2008-02-12 16:26:32.000000000 +0000
+@@ -161,7 +160,9 @@
+
+ static Proto* LoadFunction(LoadState* S, TString* p)
+ {
+- Proto* f=luaF_newproto(S->L);
++ Proto* f;
++ if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep");
++ f=luaF_newproto(S->L);
+ setptvalue2s(S->L,S->L->top,f); incr_top(S->L);
+ f->source=LoadString(S); if (f->source==NULL) f->source=p;
+ f->linedefined=LoadInt(S);
+@@ -175,6 +176,7 @@
+ LoadDebug(S,f);
+ IF (!luaG_checkcode(f), "bad code");
+ S->L->top--;
++ S->L->nCcalls--;
+ return f;
+ }
diff --git a/dev-lang/lua/files/5.1.3/07_validator2.upstream.patch b/dev-lang/lua/files/5.1.3/07_validator2.upstream.patch
new file mode 100644
index 000000000000..209d9ab30784
--- /dev/null
+++ b/dev-lang/lua/files/5.1.3/07_validator2.upstream.patch
@@ -0,0 +1,25 @@
+diff -rdu lua-5.1.3.orig/src/ldebug.c lua-5.1.3/src/ldebug.c
+--- lua-5.1.3.orig/src/ldebug.c 2008-02-12 16:17:59.000000000 +0000
++++ lua-5.1.3/src/ldebug.c 2008-02-12 16:26:32.000000000 +0000
+@@ -346,9 +346,18 @@
+ int dest = pc+1+b;
+ check(0 <= dest && dest < pt->sizecode);
+ if (dest > 0) {
+- /* cannot jump to a setlist count */
+- Instruction d = pt->code[dest-1];
+- check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));
++ int j;
++ /* check that it does not jump to a setlist count; this
++ is tricky, because the count from a previous setlist may
++ have the same value of an invalid setlist; so, we must
++ go all the way back to the first of them (if any) */
++ for (j = 0; j < dest; j++) {
++ Instruction d = pt->code[dest-1-j];
++ if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break;
++ }
++ /* if 'j' is even, previous value is not a setlist (even if
++ it looks like one) */
++ check((j&1) == 0);
+ }
+ }
+ break;
diff --git a/dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch b/dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch
new file mode 100644
index 000000000000..4d605cdb0c16
--- /dev/null
+++ b/dev-lang/lua/files/5.1.3/08_code_injection.upstream.patch
@@ -0,0 +1,12 @@
+diff -ur lua-5.1.3.orig/src/lundump.c lua-5.1.3/src/lundump.c
+--- lua-5.1.3.orig/src/lundump.c 2008-05-15 09:24:32.000000000 +0200
++++ lua-5.1.3/src/lundump.c 2008-05-15 09:25:18.000000000 +0200
+@@ -115,7 +115,7 @@
+ setnilvalue(o);
+ break;
+ case LUA_TBOOLEAN:
+- setbvalue(o,LoadChar(S));
++ setbvalue(o,LoadChar(S)!=0);
+ break;
+ case LUA_TNUMBER:
+ setnvalue(o,LoadNumber(S));
diff --git a/dev-lang/lua/lua-5.1.3-r2.ebuild b/dev-lang/lua/lua-5.1.3-r2.ebuild
new file mode 100644
index 000000000000..96b96e6aa226
--- /dev/null
+++ b/dev-lang/lua/lua-5.1.3-r2.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-lang/lua/lua-5.1.3-r2.ebuild,v 1.1 2008/05/15 11:35:16 mabi Exp $
+
+inherit eutils portability versionator
+
+DESCRIPTION="A powerful light-weight programming language designed for extending applications"
+HOMEPAGE="http://www.lua.org/"
+SRC_URI="http://www.lua.org/ftp/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
+IUSE="deprecated readline static"
+
+DEPEND="readline? ( sys-libs/readline )"
+
+src_unpack() {
+ local PATCH_PV=$(get_version_component_range 1-2)
+ unpack ${A}
+ cd "${S}"
+
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make.patch
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-module_paths.patch
+
+ EPATCH_SOURCE="${FILESDIR}/${PV}" EPATCH_SUFFIX="upstream.patch" epatch
+
+ # correct lua versioning
+ sed -i -e 's/\(LIB_VERSION = \)6:1:1/\16:3:1/' src/Makefile
+
+ sed -i -e 's:\(/README\)\("\):\1.gz\2:g' doc/readme.html
+
+ if ! use deprecated ; then
+ epatch "${FILESDIR}"/${P}-deprecated.patch
+ fi
+
+ if ! use readline ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-readline.patch
+ fi
+
+ # Using dynamic linked lua is not recommended upstream for performance
+ # reasons. http://article.gmane.org/gmane.comp.lang.lua.general/18519
+ # Mainly, this is of concern if your arch is poor with GPRs, like x86
+ # Not that this only affects the interpreter binary (named lua), not the lua
+ # compiler (built statically) nor the lua libraries (both shared and static
+ # are installed)
+ if use static ; then
+ epatch "${FILESDIR}"/${PN}-${PATCH_PV}-make_static.patch
+ fi
+
+ # We want packages to find our things...
+ sed -i -e 's:/usr/local:/usr:' etc/lua.pc
+}
+
+src_compile() {
+ myflags=
+ # what to link to liblua
+ liblibs="-lm"
+ mycflags="${mycflags} -DLUA_USE_LINUX"
+ liblibs="${liblibs} $(dlopen_lib)"
+
+ # what to link to the executables
+ mylibs=
+ if use readline; then
+ mylibs="-lreadline"
+ fi
+
+ cd src
+ emake CFLAGS="${mycflags} ${CFLAGS}" \
+ RPATH="/usr/$(get_libdir)/" \
+ LUA_LIBS="${mylibs}" \
+ LIB_LIBS="${liblibs}" \
+ V=${PV} \
+ gentoo_all || die "emake failed"
+
+ mv lua_test ../test/lua.static
+}
+
+src_install() {
+ emake INSTALL_TOP="${D}/usr/" INSTALL_LIB="${D}/usr/$(get_libdir)/" \
+ V=${PV} gentoo_install \
+ || die "emake install gentoo_install failed"
+
+ dodoc HISTORY README
+ dohtml doc/*.html doc/*.gif
+
+ insinto /usr/share/pixmaps
+ doins etc/lua.ico
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins etc/lua.pc
+
+ doman doc/lua.1 doc/luac.1
+}
+
+src_test() {
+ local positive="bisect cf echo env factorial fib fibfor hello printf sieve
+ sort trace-calls trace-globals"
+ local negative="readonly"
+ local test
+
+ cd "${S}"
+ for test in ${positive}; do
+ test/lua.static test/${test}.lua &> /dev/null || die "test $test failed"
+ done
+
+ for test in ${negative}; do
+ test/lua.static test/${test}.lua &> /dev/null && die "test $test failed"
+ done
+}