diff options
author | Philipp Stephani <phst@google.com> | 2017-06-12 16:28:16 +0200 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2017-06-12 16:28:16 +0200 |
commit | 272235c1d57c35b6cefa8c721e009a445de69dee (patch) | |
tree | 01debabf98d5f5cdf8306fd8eea902522db8220f /test | |
parent | d7f6477c0180324270b6b9cf289e8da3583b45c6 (diff) | |
download | emacs-272235c1d57c35b6cefa8c721e009a445de69dee.tar.gz |
Test module: add necessary version checks
* test/data/emacs-module/mod-test.c (emacs_module_init): Add necessary
version checks.
Diffstat (limited to 'test')
-rw-r--r-- | test/data/emacs-module/mod-test.c | 6 |
1 files changed, 6 insertions, 0 deletions
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)) |