aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/utils.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2015-09-01 19:53:40 +0200
committerSverker Eriksson <[email protected]>2015-09-01 20:01:30 +0200
commita22b5ba19193e3f39129fadd20d375f6cc3f8529 (patch)
tree98c67cd1faf69ddf19e1c3f76f536b09aebb553a /erts/emulator/beam/utils.c
parent99d3e9c5b2569169d2f5fefd67898d2533e5a83d (diff)
downloadotp-a22b5ba19193e3f39129fadd20d375f6cc3f8529.tar.gz
otp-a22b5ba19193e3f39129fadd20d375f6cc3f8529.tar.bz2
otp-a22b5ba19193e3f39129fadd20d375f6cc3f8529.zip
erts: Fix bug when tracing with 'process_dump'
If the process stack contained a match state the print function would crash the vm as it was not recognized by tag_val_def(). Add new MATCHSTATE_DEF returned by tag_val_def(). All other callers either ignore it or has a default clause to handle invalid terms.
Diffstat (limited to 'erts/emulator/beam/utils.c')
-rw-r--r--erts/emulator/beam/utils.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c
index f810fca9a4..a8bbdb9354 100644
--- a/erts/emulator/beam/utils.c
+++ b/erts/emulator/beam/utils.c
@@ -788,11 +788,10 @@ Uint32 make_hash(Eterm term_arg)
Eterm hash = 0;
unsigned op;
- /* Must not collide with the real tag_val_def's: */
-#define MAKE_HASH_TUPLE_OP 0x11
-#define MAKE_HASH_TERM_ARRAY_OP 0x12
-#define MAKE_HASH_CDR_PRE_OP 0x13
-#define MAKE_HASH_CDR_POST_OP 0x14
+#define MAKE_HASH_TUPLE_OP (FIRST_VACANT_TAG_DEF)
+#define MAKE_HASH_TERM_ARRAY_OP (FIRST_VACANT_TAG_DEF+1)
+#define MAKE_HASH_CDR_PRE_OP (FIRST_VACANT_TAG_DEF+2)
+#define MAKE_HASH_CDR_POST_OP (FIRST_VACANT_TAG_DEF+3)
/*
** Convenience macro for calculating a bytewise hash on an unsigned 32 bit