aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-01-16 20:56:34 +0100
committerSverker Eriksson <[email protected]>2017-01-16 20:56:34 +0100
commit3046ab2d72fe1a5b450640d776446b373a22c168 (patch)
tree8bb24ef425d0e3a4954fc2a5fb32ec3227dbb72f /erts/emulator/beam/beam_load.c
parentcc742052e0cb63a7c38dde2e4a39ba689832492a (diff)
parent228e34eb3eb75dd0cac1c7137861ee4a7b5b3f69 (diff)
downloadotp-3046ab2d72fe1a5b450640d776446b373a22c168.tar.gz
otp-3046ab2d72fe1a5b450640d776446b373a22c168.tar.bz2
otp-3046ab2d72fe1a5b450640d776446b373a22c168.zip
Merge branch 'maint'
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 8f1faa6719..309465bcd3 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -800,14 +800,14 @@ erts_finish_loading(Binary* magic, Process* c_p,
} else {
ErtsCodeIndex code_ix = erts_staging_code_ix();
Eterm module = stp->module;
- int i;
+ int i, num_exps;
/*
* There is an -on_load() function. We will keep the current
* code, but we must turn off any tracing.
*/
-
- for (i = 0; i < export_list_size(code_ix); i++) {
+ num_exps = export_list_size(code_ix);
+ for (i = 0; i < num_exps; i++) {
Export *ep = export_list(i, code_ix);
if (ep == NULL || ep->info.mfa.module != module) {
continue;
@@ -5724,12 +5724,13 @@ exported_from_module(Process* p, /* Process whose heap to use. */
ErtsCodeIndex code_ix,
Eterm mod) /* Tagged atom for module. */
{
- int i;
+ int i, num_exps;
Eterm* hp = NULL;
Eterm* hend = NULL;
Eterm result = NIL;
- for (i = 0; i < export_list_size(code_ix); i++) {
+ num_exps = export_list_size(code_ix);
+ for (i = 0; i < num_exps; i++) {
Export* ep = export_list(i,code_ix);
if (ep->info.mfa.module == mod) {