aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-02-12 16:46:33 +0100
committerLukas Larsson <[email protected]>2019-02-22 11:12:54 +0100
commitbf7c722bd3b30e04a56c2d369fd9f5501a8316d0 (patch)
tree64bc891786d71282e653224153799dc03eff28d8 /erts/emulator/beam/utils.c
parentc0c6f6b137e91f626157389733d1510c192002cf (diff)
downloadotp-bf7c722bd3b30e04a56c2d369fd9f5501a8316d0.tar.gz
otp-bf7c722bd3b30e04a56c2d369fd9f5501a8316d0.tar.bz2
otp-bf7c722bd3b30e04a56c2d369fd9f5501a8316d0.zip
erts: Fix so that externals with creation 0 compare equal to all
The special creation of 0 is used by internally created externals, such as when list_to_pid is called. This creation should compare equal to all externals creations of that external. If it does not we can end up in very strange scenarios. For instance: > P = spawn(OtherNode, fun() -> die end). <8303.60.0> > link(<8303.60.0>). true > flush(). ok OTP-15613
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index 3fa09e39f2..36a492f00d 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -2701,7 +2701,8 @@ Sint erts_cmp_compound(Eterm a, Eterm b, int exact, int eq_only)
if((AN)->sysname != (BN)->sysname) \
RETURN_NEQ(erts_cmp_atoms((AN)->sysname, (BN)->sysname)); \
ASSERT((AN)->creation != (BN)->creation); \
- RETURN_NEQ(((AN)->creation < (BN)->creation) ? -1 : 1); \
+ if ((AN)->creation != 0 && (BN)->creation != 0) \
+ RETURN_NEQ(((AN)->creation < (BN)->creation) ? -1 : 1); \
} \
} while (0)