Mercurial > hg > xemacs-beta
comparison 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 |
comparison
equal
deleted
inserted
replaced
5292:e4305eb6fb8c | 5293:63f247c5da0a |
---|---|
388 | 388 |
389 f = (const Extbyte **) dll_variable (dlhandle, | 389 f = (const Extbyte **) dll_variable (dlhandle, |
390 (const Ibyte *) "emodule_name"); | 390 (const Ibyte *) "emodule_name"); |
391 if (f == NULL || *f == NULL) | 391 if (f == NULL || *f == NULL) |
392 signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_name'", Qunbound); | 392 signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_name'", Qunbound); |
393 | 393 mname = EXTERNAL_TO_ITEXT (*f, Qemodule_string_encoding); |
394 mname = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding); | |
395 /* #### Not obvious we have to force an alloca copy here, but the old | |
396 code did so */ | |
397 IBYTE_STRING_TO_ALLOCA (mname, mname); | |
398 | 394 |
399 if (mname[0] == '\0') | 395 if (mname[0] == '\0') |
400 signal_error (Qdll_error, "Invalid dynamic module: Empty value for `emodule_name'", Qunbound); | 396 signal_error (Qdll_error, "Invalid dynamic module: Empty value for `emodule_name'", Qunbound); |
401 | 397 |
402 f = (const Extbyte **) dll_variable (dlhandle, | 398 f = (const Extbyte **) dll_variable (dlhandle, |
403 (const Ibyte *) "emodule_version"); | 399 (const Ibyte *) "emodule_version"); |
404 if (f == NULL || *f == NULL) | 400 if (f == NULL || *f == NULL) |
405 signal_error (Qdll_error, "Missing symbol `emodule_version': Invalid dynamic module", Qunbound); | 401 signal_error (Qdll_error, "Missing symbol `emodule_version': Invalid dynamic module", Qunbound); |
406 | 402 mver = EXTERNAL_TO_ITEXT (*f, Qemodule_string_encoding); |
407 mver = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding); | |
408 /* #### Not obvious we have to force an alloca copy here, but the old | |
409 code did so */ | |
410 IBYTE_STRING_TO_ALLOCA (mver, mver); | |
411 | 403 |
412 f = (const Extbyte **) dll_variable (dlhandle, | 404 f = (const Extbyte **) dll_variable (dlhandle, |
413 (const Ibyte *) "emodule_title"); | 405 (const Ibyte *) "emodule_title"); |
414 if (f == NULL || *f == NULL) | 406 if (f == NULL || *f == NULL) |
415 signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_title'", Qunbound); | 407 signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_title'", Qunbound); |
416 | 408 mtitle = EXTERNAL_TO_ITEXT (*f, Qemodule_string_encoding); |
417 mtitle = EXTERNAL_TO_ITEXT (f, Qemodule_string_encoding); | |
418 /* #### Not obvious we have to force an alloca copy here, but the old | |
419 code did so */ | |
420 IBYTE_STRING_TO_ALLOCA (mtitle, mtitle); | |
421 | 409 |
422 symname = alloca_ibytes (qxestrlen (mname) + 15); | 410 symname = alloca_ibytes (qxestrlen (mname) + 15); |
423 | 411 |
424 qxestrcpy_ascii (symname, "modules_of_"); | 412 qxestrcpy_ascii (symname, "modules_of_"); |
425 qxestrcat (symname, mname); | 413 qxestrcat (symname, mname); |