From xemacs-m  Sat Jun 28 15:15:28 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id PAA19064
	for <xemacs-beta@xemacs.org>; Sat, 28 Jun 1997 15:15:27 -0500 (CDT)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.6/8.8.6) id NAA05601;
	Sat, 28 Jun 1997 13:18:20 -0700
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: Re: XEmacs internal corruption integer `0' plist -- test case
References: <m2k9jeppxm.fsf@altair.xemacs.org> <QQcvxt03404.199706281921@crystal.WonderWorks.COM> <kig4taiv83t.fsf@jagor.srce.hr>
X-Url: http://www.miranova.com/%7Esteve/
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@xemacs.org>
In-Reply-To: Hrvoje Niksic's message of "28 Jun 1997 21:29:58 +0200"
Mime-Version: 1.0 (generated by tm-edit 7.108)
Content-Type: text/plain; charset=US-ASCII
Date: 28 Jun 1997 13:18:15 -0700
Message-ID: <m2u3iixz08.fsf@altair.xemacs.org>
Lines: 61
X-Mailer: Gnus v5.4.59/XEmacs 20.3(beta10) - "Athens"

Hrvoje Niksic <hniksic@srce.hr> writes:

> Kyle Jones <kyle_jones@wonderworks.com> writes:
> [Per Abrahamsen:]
>> Any idea how (symbol-plist 'toolbar-cut) can be anything but a plist?
>> 
>> I really hope this is an XEmacs bug, otherwise I'll have to put each
>> use of `get' inside a condition-case.

> As David Moore pointed out then, and I'll repeat now: It is PERFECTLY
> LEGAL in XEmacs and GNU Emacs to do something like:

> (setplist 'foo 10)
> (symbol-plist 'foo)
>   => 10                 ; what a plist!

> We mustn't even put a check to `setplist', because there are packages
> actually /using/ this horrible, brain-dead feature!

Sigh.  What other packages besides abbrev use it?

> If anything, we might patch up `get' to not die on malformed plists,
> but that would be gross.  I'd rather find the bug.

True, it would be nice to know where this is coming from.
Symbol-plist and get use two completely different methods.

DEFUN ("symbol-plist", Fsymbol_plist, 1, 1, 0, /*
Return SYMBOL's property list.
*/
       (sym))
{
  CHECK_SYMBOL (sym);
  return XSYMBOL (sym)->plist;
}


Get winds up calling the function symbol_getprop():

/* Symbol plists are directly accessible, so we need to protect against
   invalid property list structure */

static Lisp_Object
symbol_getprop (Lisp_Object sym, Lisp_Object propname, Lisp_Object defalt)
{
  Lisp_Object val = external_plist_get (&XSYMBOL (sym)->plist, propname,
					0, ERROR_ME);
  if (UNBOUNDP (val))
    return defalt;
  return val;
}


Why one apparently random symbol?  Why `0' now that abbrev.el should
stay in its own sandbox?

Oh boy `(setf (symbol-plist 'foo) 0)' works -- another set of cases
to grep for ...
-- 
steve@calag.com baur
Unsolicited commercial e-mail will be billed at $250/message.

