* src/emacs-module.c (finalize_runtime_unwind): Don't finalize initial
environment twice.
* test/src/emacs-module-resources/mod-test.c (emacs_module_init):
Allocate lots of values during module initialization to trigger the
bug.
void
finalize_runtime_unwind (void *raw_ert)
{
- struct emacs_runtime *ert = raw_ert;
- finalize_environment (ert->private_members->env);
+ /* No further cleanup is required, as the initial environment is
+ unwound separately. See the logic in Fmodule_load. */
}
\f
strlen (interactive_spec)));
bind_function (env, "mod-test-identity", identity_fn);
+ /* We allocate lots of values to trigger bugs in the frame allocator during
+ initialization. */
+ int count = 10000; /* larger than value_frame_size in emacs-module.c */
+ for (int i = 0; i < count; ++i)
+ env->make_integer (env, i);
+
provide (env, "mod-test");
return 0;
}