diff options
| author | Philipp Stephani | 2017-06-12 16:28:16 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-12 16:28:16 +0200 |
| commit | 272235c1d57c35b6cefa8c721e009a445de69dee (patch) | |
| tree | 01debabf98d5f5cdf8306fd8eea902522db8220f /test/data | |
| parent | d7f6477c0180324270b6b9cf289e8da3583b45c6 (diff) | |
| download | emacs-272235c1d57c35b6cefa8c721e009a445de69dee.tar.gz emacs-272235c1d57c35b6cefa8c721e009a445de69dee.zip | |
Test module: add necessary version checks
* test/data/emacs-module/mod-test.c (emacs_module_init): Add necessary
version checks.
Diffstat (limited to 'test/data')
| -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) | |||
| 264 | int | 264 | int |
| 265 | emacs_module_init (struct emacs_runtime *ert) | 265 | emacs_module_init (struct emacs_runtime *ert) |
| 266 | { | 266 | { |
| 267 | if (ert->size < sizeof *ert) | ||
| 268 | return 1; | ||
| 269 | |||
| 267 | emacs_env *env = ert->get_environment (ert); | 270 | emacs_env *env = ert->get_environment (ert); |
| 268 | 271 | ||
| 272 | if (env->size <= sizeof *env) | ||
| 273 | return 2; | ||
| 274 | |||
| 269 | #define DEFUN(lsym, csym, amin, amax, doc, data) \ | 275 | #define DEFUN(lsym, csym, amin, amax, doc, data) \ |
| 270 | bind_function (env, lsym, \ | 276 | bind_function (env, lsym, \ |
| 271 | env->make_function (env, amin, amax, csym, doc, data)) | 277 | env->make_function (env, amin, amax, csym, doc, data)) |