aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_db_hash.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-04-08 17:03:08 +0200
committerSverker Eriksson <[email protected]>2015-04-08 17:03:08 +0200
commitfca1348be883e25fcdeca0e9879036b6cd87ac23 (patch)
tree4fe00f42ff8f13a1faa0340a5878a4fddd00418c /erts/emulator/beam/erl_db_hash.c
parent3698284c3746d913ada051f3370e567b8202b5d9 (diff)
parenta4d1a73370dffa6ac96ee70693fd1bd335bd70fe (diff)
downloadotp-fca1348be883e25fcdeca0e9879036b6cd87ac23.tar.gz
otp-fca1348be883e25fcdeca0e9879036b6cd87ac23.tar.bz2
otp-fca1348be883e25fcdeca0e9879036b6cd87ac23.zip
Merge branch 'sverk/ets-grow-faulty-assert/OTP-12647'
* sverk/ets-grow-faulty-assert/OTP-12647: erts: Fix ets bug in debug VM
Diffstat (limited to 'erts/emulator/beam/erl_db_hash.c')
-rw-r--r--erts/emulator/beam/erl_db_hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_db_hash.c b/erts/emulator/beam/erl_db_hash.c
index 045c8ae135..383ee7c430 100644
--- a/erts/emulator/beam/erl_db_hash.c
+++ b/erts/emulator/beam/erl_db_hash.c
@@ -2471,10 +2471,10 @@ static int alloc_seg(DbTableHash *tb)
*/
static int free_seg(DbTableHash *tb, int free_records)
{
- int seg_ix = (tb->nslots >> SEGSZ_EXP) - 1;
+ const int seg_ix = (tb->nslots >> SEGSZ_EXP) - 1;
+ struct segment** const segtab = SEGTAB(tb);
+ struct ext_segment* const top = (struct ext_segment*) segtab[seg_ix];
int bytes;
- struct segment** segtab = SEGTAB(tb);
- struct ext_segment* top = (struct ext_segment*) segtab[seg_ix];
int nrecords = 0;
ASSERT(top != NULL);
@@ -2537,7 +2537,7 @@ static int free_seg(DbTableHash *tb, int free_records)
(void*)top, bytes);
#ifdef DEBUG
if (seg_ix > 0) {
- if (seg_ix < tb->nsegs) SEGTAB(tb)[seg_ix] = NULL;
+ segtab[seg_ix] = NULL;
} else {
SET_SEGTAB(tb, NULL);
}