From: Philipp Stephani Date: Mon, 12 Jun 2017 14:28:16 +0000 (+0200) Subject: Test module: add necessary version checks X-Git-Tag: emacs-26.0.90~521^2~111 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=272235c1d57c35b6cefa8c721e009a445de69dee;p=emacs.git Test module: add necessary version checks * test/data/emacs-module/mod-test.c (emacs_module_init): Add necessary version checks. --- diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index fc29a0d6b9a..f378db00cd4 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c @@ -264,8 +264,14 @@ bind_function (emacs_env *env, const char *name, emacs_value Sfun) int emacs_module_init (struct emacs_runtime *ert) { + if (ert->size < sizeof *ert) + return 1; + emacs_env *env = ert->get_environment (ert); + if (env->size <= sizeof *env) + return 2; + #define DEFUN(lsym, csym, amin, amax, doc, data) \ bind_function (env, lsym, \ env->make_function (env, amin, amax, csym, doc, data))