Mercurial > hg > xemacs-beta
diff src/emodules.c @ 5293:63f247c5da0a
In emodules_load(), dereference f = dll_variable() once more.
We then use EXTERNAL_TO_ITEXT on it, which returns an alloca'd
string, so I delete the unneeded alloca copy statements.
Fixes error reported by Anders Odberg, confirmed in
<rfawrpfhm3l.fsf@fangorn.uio.no>.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Mon, 18 Oct 2010 23:43:03 +0900 |
parents | 6c6d78781d59 |
children | b9167d522a9a |
line wrap: on
line diff
--- a/src/emodules.c Mon Oct 18 23:21:23 2010 +0900 +++ b/src/emodules.c Mon Oct 18 23:43:03 2010 +0900 @@ -390,11 +390,7 @@ (const Ibyte *) "emodule_name"); if (f == NULL || *f == NULL) signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_name'", Qunbound); - - mname = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding); - /* #### Not obvious we have to force an alloca copy here, but the old - code did so */ - IBYTE_STRING_TO_ALLOCA (mname, mname); + mname = EXTERNAL_TO_ITEXT (*f, Qemodule_string_encoding); if (mname[0] == '\0') signal_error (Qdll_error, "Invalid dynamic module: Empty value for `emodule_name'", Qunbound); @@ -403,21 +399,13 @@ (const Ibyte *) "emodule_version"); if (f == NULL || *f == NULL) signal_error (Qdll_error, "Missing symbol `emodule_version': Invalid dynamic module", Qunbound); - - mver = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding); - /* #### Not obvious we have to force an alloca copy here, but the old - code did so */ - IBYTE_STRING_TO_ALLOCA (mver, mver); + mver = EXTERNAL_TO_ITEXT (*f, Qemodule_string_encoding); f = (const Extbyte **) dll_variable (dlhandle, (const Ibyte *) "emodule_title"); if (f == NULL || *f == NULL) signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_title'", Qunbound); - - mtitle = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding); - /* #### Not obvious we have to force an alloca copy here, but the old - code did so */ - IBYTE_STRING_TO_ALLOCA (mtitle, mtitle); + mtitle = EXTERNAL_TO_ITEXT (*f, Qemodule_string_encoding); symname = alloca_ibytes (qxestrlen (mname) + 15);