From a5aaba7c9a316327940d0b861dd300d59aa99209 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 21 Nov 2017 14:40:06 +0100 Subject: erts: Fix preemption bug in erts_dist_command We should break out when out of reductions. --- erts/emulator/beam/dist.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'erts') diff --git a/erts/emulator/beam/dist.c b/erts/emulator/beam/dist.c index 16a7bd9eb3..ee288dc0bd 100644 --- a/erts/emulator/beam/dist.c +++ b/erts/emulator/beam/dist.c @@ -2335,10 +2335,10 @@ erts_dist_command(Port *prt, int initial_reds) ASSERT(ob); do { reds = erts_encode_ext_dist_header_finalize(ob, dep, flags, reds); - if (reds >= 0) { - last_finalized = ob; - ob = ob->next; - } + if (reds < 0) + break; + last_finalized = ob; + ob = ob->next; } while (ob); if (last_finalized) { /* -- cgit v1.2.3