From fc1410099d6ccbb72adb54ecffd0711348706ca4 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 27 Feb 2022 20:39:54 +0200 Subject: Have cant_happen() give more information. --- profile.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'profile.c') diff --git a/profile.c b/profile.c index c17d633c..62e39e93 100644 --- a/profile.c +++ b/profile.c @@ -373,8 +373,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags) break; default: - fprintf(stderr, "Got unexpected type %s\n", nodetype2str(m->type)); - cant_happen(); + cant_happen("got unexpected type %s", nodetype2str(m->type)); } switch (pc->opcode) { @@ -581,7 +580,7 @@ cleanup: case Op_K_delete_loop: /* Efficency hack not in effect because of exec_count instruction */ - cant_happen(); + cant_happen("unexpected opcode %s", opcode2str(pc->opcode)); break; case Op_in_array: @@ -1219,7 +1218,7 @@ cleanup: break; default: - cant_happen(); + cant_happen("unexpected opcode %s", opcode2str(pc->opcode)); } if (pc == endp) -- cgit v1.2.3