diff options
author | Erlang/OTP <[email protected]> | 2018-07-20 14:09:37 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2018-07-20 14:09:37 +0200 |
commit | ad2205cd987bd701207b584bc6a425ffee247a1c (patch) | |
tree | 87d1df0292ae273fcd8de8026361ab5b8be9cf63 | |
parent | 0c31b507248744582724a2112079edd09e62afb3 (diff) | |
parent | 346494638829cb4440aea106dbfc3ede45e1d274 (diff) | |
download | otp-ad2205cd987bd701207b584bc6a425ffee247a1c.tar.gz otp-ad2205cd987bd701207b584bc6a425ffee247a1c.tar.bz2 otp-ad2205cd987bd701207b584bc6a425ffee247a1c.zip |
Merge branch 'sverker/crash-dump-crash-literals/OTP-15181' into maint-20
* sverker/crash-dump-crash-literals/OTP-15181:
erts: Fix bug in crash dump generation
-rw-r--r-- | erts/emulator/beam/beam_ranges.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_ranges.c b/erts/emulator/beam/beam_ranges.c index c7b17d58f3..9570fb34db 100644 --- a/erts/emulator/beam/beam_ranges.c +++ b/erts/emulator/beam/beam_ranges.c @@ -35,10 +35,8 @@ typedef struct { /* * Used for crash dumping of literals. The size of erts_dump_lit_areas is - * always twice the number of active ranges (to allow for literals in both - * current and old code). + * always at least the number of active ranges. */ - ErtsLiteralArea** erts_dump_lit_areas; Uint erts_dump_num_lit_areas; @@ -180,8 +178,8 @@ erts_end_staging_ranges(int commit) (erts_aint_t) (r[dst].modules + r[dst].n / 2)); - if (r[dst].allocated * 2 > erts_dump_num_lit_areas) { - erts_dump_num_lit_areas *= 2; + if (r[dst].allocated > erts_dump_num_lit_areas) { + erts_dump_num_lit_areas = r[dst].allocated * 2; erts_dump_lit_areas = (ErtsLiteralArea **) erts_realloc(ERTS_ALC_T_CRASH_DUMP, (void *) erts_dump_lit_areas, |