commit: When aborting due to unknown opcode, output more descriptive msg

Ben Wing ben at xemacs.org
Tue Feb 2 16:19:32 EST 2010


changeset:   4914:1628e3b9601a
tag:         tip
user:        Ben Wing <ben at xemacs.org>
date:        Tue Feb 02 15:19:15 2010 -0600
files:       src/ChangeLog src/bytecode.c src/lisp.h
description:
When aborting due to unknown opcode, output more descriptive msg

-------------------- ChangeLog entries follow: --------------------

src/ChangeLog addition:

2010-02-02  Ben Wing  <ben at xemacs.org>

	* bytecode.c (execute_rare_opcode):
	* lisp.h (abort_with_msg): New.
	When aborting due to unknown opcode, output more descriptive msg.


diff -r fc28cc192c91 -r 1628e3b9601a src/ChangeLog
--- a/src/ChangeLog	Mon Feb 01 23:14:46 2010 -0600
+++ b/src/ChangeLog	Tue Feb 02 15:19:15 2010 -0600
@@ -1,3 +1,9 @@
+2010-02-02  Ben Wing  <ben at xemacs.org>
+
+	* bytecode.c (execute_rare_opcode):
+	* lisp.h (abort_with_msg): New.
+	When aborting due to unknown opcode, output more descriptive msg.
+
 2010-02-01  Vin Shelton  <acs at xemacs.org>
 
 	* intl-encap-win32.c: Added description of override keyword.
diff -r fc28cc192c91 -r 1628e3b9601a src/bytecode.c
--- a/src/bytecode.c	Mon Feb 01 23:14:46 2010 -0600
+++ b/src/bytecode.c	Tue Feb 02 15:19:15 2010 -0600
@@ -1738,7 +1738,11 @@
       }
 
     default:
-      ABORT();
+      {
+	Ascbyte msg[100];
+	sprintf (msg, "Unknown opcode %d", opcode);
+	abort_with_msg (msg);
+      }
       break;
     }
   return stack_ptr;
diff -r fc28cc192c91 -r 1628e3b9601a src/lisp.h
--- a/src/lisp.h	Mon Feb 01 23:14:46 2010 -0600
+++ b/src/lisp.h	Tue Feb 02 15:19:15 2010 -0600
@@ -1253,7 +1253,8 @@
 /* Highly dubious kludge */
 /*   (thanks, Jamie, I feel better now -- ben) */
 MODULE_API void assert_failed (const Ascbyte *, int, const Ascbyte *);
-#define ABORT() (assert_failed (__FILE__, __LINE__, "ABORT()"))
+#define ABORT() assert_failed (__FILE__, __LINE__, "ABORT()")
+#define abort_with_msg(msg) assert_failed (__FILE__, __LINE__, msg)
 
 /* This used to be ((void) (0)) but that triggers lots of unused variable
    warnings.  It's pointless to force all that code to be rewritten, with



More information about the XEmacs-Patches mailing list