summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpschwan <pschwan>2006-09-26 02:03:59 (GMT)
committerpschwan <pschwan>2006-09-26 02:03:59 (GMT)
commit0e32fba9aa99a2b743869531793ff543b6f7f1cc (patch)
tree3a709edbd2e21be32c4b68f093f7cea926cdba72
parentb265da3e3472467d7b42be3a09194f4ab23f90f6 (diff)
downloadmoo-0e32fba9aa99a2b743869531793ff543b6f7f1cc.zip
moo-0e32fba9aa99a2b743869531793ff543b6f7f1cc.tar.gz
moo-0e32fba9aa99a2b743869531793ff543b6f7f1cc.tar.bz2
moo-0e32fba9aa99a2b743869531793ff543b6f7f1cc.tar.xz
b=1552816
r=ben execute.c:run_interpreter() sometimes clobbers the real return code with that of the traceback handler. If |result| is non-NULL, this can lead to it being used later on without ever having been initialized, causing "Unknown Var type" errors. In practice -- because |result| is almost always NULL or (in one case) initialized before calling run_interpreter() -- this situation wasn't encountered execept in Emergency Mode.
-rw-r--r--ChangeLog.txt4
-rw-r--r--execute.c26
2 files changed, 24 insertions, 6 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index 9a71808..168e6ba 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -2403,6 +2403,10 @@ Version 1.8.2, in progress
with this string will be stripped of this prefix and processed normally, even
if the resulting line begins with OUT_OF_BAND_PREFIX. This provides a means
of quoting lines that would otherwise trigger do_out_of_band_command.
+-- Added a new compile option (MEMO_STRLEN in options.h) that optimizes away
+ most strlen computations.
+-- SF bug #1552816: fixed an issue that could cause tracebacks in emergency mode
+ to produce "Unknown Var type" errors
**** Changes relevant to server hackers:
-- New call_verb2() accepts verb name that is a MOO string (ie, str_ref-able)
-- str_hash() replaced with a faster (and better?) string hash function
diff --git a/execute.c b/execute.c
index 9a4cfcd..e361663 100644
--- a/execute.c
+++ b/execute.c
@@ -2121,18 +2121,19 @@ run_interpreter(char raise, enum error e,
if (ret == OUTCOME_ABORTED && handler_verb_name) {
db_verb_handle h;
+ enum outcome hret;
Var args, handled, traceback;
int i;
args = handler_verb_args;
h = db_find_callable_verb(SYSTEM_OBJECT, handler_verb_name);
if (do_db_tracebacks && h.ptr) {
- ret = do_server_verb_task(SYSTEM_OBJECT, handler_verb_name,
- var_ref(handler_verb_args), h,
- activ_stack[0].player, "", &handled,
- 0/*no-traceback*/);
- if ((ret == OUTCOME_DONE && is_true(handled))
- || ret == OUTCOME_BLOCKED) {
+ hret = do_server_verb_task(SYSTEM_OBJECT, handler_verb_name,
+ var_ref(handler_verb_args), h,
+ activ_stack[0].player, "", &handled,
+ 0/*no-traceback*/);
+ if ((hret == OUTCOME_DONE && is_true(handled))
+ || hret == OUTCOME_BLOCKED) {
/* Assume the in-DB code handled it */
free_var(args);
return OUTCOME_ABORTED; /* original ret value */
@@ -2874,6 +2875,19 @@ char rcsid_execute[] = "$Id$";
/*
* $Log$
+ * Revision 1.18 2006/09/26 02:03:59 pschwan
+ * b=1552816
+ * r=ben
+ *
+ * execute.c:run_interpreter() sometimes clobbers the real return code with that
+ * of the traceback handler. If |result| is non-NULL, this can lead to it being
+ * used later on without ever having been initialized, causing "Unknown Var type"
+ * errors.
+ *
+ * In practice -- because |result| is almost always NULL or (in one case)
+ * initialized before calling run_interpreter() -- this situation wasn't
+ * encountered execept in Emergency Mode.
+ *
* Revision 1.17 2006/09/07 00:55:02 bjj
* Add new MEMO_STRLEN option which uses the refcounting mechanism to
* store strlen with strings. This is basically free, since most string