;; resending because I'm stupid and I forgot to attach the patch (and I can't
;; figure how to reply to my own message)

Hello hackers,
here's a small patch that prevents `##sys#dump-heap-state` to segfault when the
heap contains one of those newfangled numeric types.

Cheers,
LemonBoy
>From 039f5565a906ad2c53a08775aa914a24162d5634 Mon Sep 17 00:00:00 2001
From: LemonBoy <thatle...@gmail.com>
Date: Wed, 30 Aug 2017 13:42:38 +0200
Subject: [PATCH] Teach the heap dumper about the new number formats

Prevents a segfault when a {cplx,big,rat}num was found.
---
 runtime.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/runtime.c b/runtime.c
index a2ccfd4e..ba2ec26d 100644
--- a/runtime.c
+++ b/runtime.c
@@ -12473,6 +12473,9 @@ static void C_ccall dump_heap_state_2(C_word c, C_word *av)
       case C_WEAK_PAIR_TYPE: C_fprintf(C_stderr,      C_text("weak pair      ")); break;
       case C_VECTOR_TYPE: C_fprintf(C_stderr,         C_text("vector         ")); break;
       case C_BYTEVECTOR_TYPE: C_fprintf(C_stderr,     C_text("bytevector     ")); break;
+      case C_BIGNUM_TYPE: C_fprintf(C_stderr,         C_text("bignum         ")); break;
+      case C_CPLXNUM_TYPE: C_fprintf(C_stderr,        C_text("cplxnum        ")); break;
+      case C_RATNUM_TYPE: C_fprintf(C_stderr,         C_text("ratnum         ")); break;
 	/* XXX this is sort of funny: */
       case C_BYTEBLOCK_BIT: C_fprintf(C_stderr,        C_text("blob           ")); break;
       default:
-- 
2.11.0

_______________________________________________
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers

Reply via email to