aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/misc/show_msg.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/erl_interface/src/misc/show_msg.c')
-rw-r--r--lib/erl_interface/src/misc/show_msg.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/erl_interface/src/misc/show_msg.c b/lib/erl_interface/src/misc/show_msg.c
index ad003605ad..2d49eb6449 100644
--- a/lib/erl_interface/src/misc/show_msg.c
+++ b/lib/erl_interface/src/misc/show_msg.c
@@ -24,6 +24,13 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+#ifndef SIZE_MAX
+# define SIZE_MAX (~((size_t)0))
+#endif
#include <sys/types.h>
@@ -455,6 +462,12 @@ static void show_term(const char *termbuf, int *index, FILE *stream)
fprintf(stream,"#Bin<%ld>",num);
break;
+ case ERL_BIT_BINARY_EXT: {
+ size_t bits;
+ ei_decode_bitstring(termbuf, index, NULL, SIZE_MAX, &bits);
+ fprintf(stream, "#Bits<%lu>", (unsigned long)bits);
+ break;
+ }
case ERL_LARGE_BIG_EXT:
/* doesn't actually decode - just skip over it */
/* FIXME if GMP, what to do here?? */