unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: Unsafe psyntax label generation
Date: Thu, 26 Jan 2012 12:26:51 +0100	[thread overview]
Message-ID: <87ehumaemc.fsf@pobox.com> (raw)
In-Reply-To: <87mx9cr21z.fsf@netris.org> (Mark H. Weaver's message of "Tue, 24 Jan 2012 20:41:44 -0500")

Heya Mark,

On Wed 25 Jan 2012 02:41, Mark H Weaver <mhw@netris.org> writes:

>> On Tue 24 Jan 2012 15:01, Mark H Weaver <mhw@netris.org> writes:
>>
>>> `local-eval' combines syntax objects from two different sessions into a
>>> single syntax object (in the wrapper procedure), and thus there may be
>>> label name collisions.  Now, if this combined syntax object is
>>> serialized as a compiled procedure, these labels with the same name will
>>> be optimized together into the same string object!
>>
> How would you like to fix this?  Would you like me to make a new
> procedure that creates a universally-unique string?  Most of `gensym's
> current code would be moved to that new procedure, and then `gensym'
> would use it.

I effectively did that: both marks and labels are now globally unique.

At some point though, I realized that not all gensyms need to be
globally unique.  For example, the gensyms used in Tree-IL only need to
be unique within a session.  So in the end I reverted your gensym patch,
and reworked some pieces of it to provide a "session identifier" to the
expander, which is included in generated symbols and strings that need
to be unique across sessions.  The procedure that provides this
identifier then gets shunted off into the (system syntax) toolshed after
boot.

Comments very much welcome, and thanks again for working on this
problem.

Andy
-- 
http://wingolog.org/



      parent reply	other threads:[~2012-01-26 11:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-24 14:01 Unsafe psyntax label generation Mark H Weaver
2012-01-24 21:27 ` Andy Wingo
2012-01-25  1:41   ` Mark H Weaver
2012-01-25 13:21     ` Ludovic Courtès
2012-01-25 14:27       ` Andy Wingo
2012-01-25 13:46     ` David Kastrup
2012-01-26 11:26     ` Andy Wingo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ehumaemc.fsf@pobox.com \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).