aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2016-07-27 17:00:32 +0200
committerBjörn-Egil Dahlberg <[email protected]>2016-08-01 11:00:22 +0200
commita9368b3c1ee78a3c83fcff83590a3d94ea4ddbe0 (patch)
tree5e5014f70548557e370eb546948b4e95e66ea57d
parenta2359927ca4e7c315e9849deec3375b1f2ae4170 (diff)
downloadotp-a9368b3c1ee78a3c83fcff83590a3d94ea4ddbe0.tar.gz
otp-a9368b3c1ee78a3c83fcff83590a3d94ea4ddbe0.tar.bz2
otp-a9368b3c1ee78a3c83fcff83590a3d94ea4ddbe0.zip
erts: Fix literal size calculation in check_process_code
We want to know the total size of literals of all heap fragmens.
-rw-r--r--erts/emulator/beam/beam_bif_load.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c
index 15e878ba65..2a165bed00 100644
--- a/erts/emulator/beam/beam_bif_load.c
+++ b/erts/emulator/beam/beam_bif_load.c
@@ -873,12 +873,12 @@ check_process_code(Process* rp, Module* modp, Uint flags, int *redsp, int fcalls
continue;
{
ErlHeapFragment *hf;
- Uint lit_sz;
+ Uint lit_sz = 0;
for (hf=hfrag; hf; hf = hf->next) {
if (check_mod_funs(rp, &hfrag->off_heap, mod_start, mod_size))
return am_true;
- lit_sz = hfrag_literal_size(&hf->mem[0], &hf->mem[hf->used_size],
- literals, lit_bsize);
+ lit_sz += hfrag_literal_size(&hf->mem[0], &hf->mem[hf->used_size],
+ literals, lit_bsize);
}
if (lit_sz > 0) {
ErlHeapFragment *bp = new_message_buffer(lit_sz);