From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: completion on brace + 4 characters doesn't work
Date: Fri, 29 Apr 2011 07:20:32 -0700 [thread overview]
Message-ID: <110429072032.ZM13518@torch.brasslantern.com> (raw)
In-Reply-To: <20110429084444.GE5625@prunille.vinc17.org>
On Apr 29, 10:44am, Vincent Lefevre wrote:
}
} > The code there apparently assumes a naive implementation of strcpy()
} > that goes left-to-right incrementing the source and destination
} > pointers in lock step.
}
} It also assumes that the length of the string is less than len
Not really, because if the naive copy is done then the only thing
that matters is that len >= 0.
} (because the source and the destination may not overlap). The
} compiler can use this fact to optimize the code. And as this is
} not true, the generated code may be incorrect.
Yes, I was aware of all this, I just didn't think it was worth spelling
out (it's implicitly not "naive"). Keep in mind that this portion of
zle_tricky.c was written at least 10 years ago by a college student;
zsh was rarely if ever built with highly-optimized compilers/libc on
64-bit platforms, at the time.
Which is why I said:
} > It would not surprise me to
} > find this assumption made elsewhere in the zsh sources.
I don't suppose you could run through the entire "make check" test
suite under valgrind? Even that won't exercise everything but it'll
find the ones most likely to bite somebody.
next prev parent reply other threads:[~2011-04-29 14:20 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-28 11:11 Vincent Lefevre
2011-04-28 15:12 ` Bart Schaefer
2011-04-28 22:27 ` Vincent Lefevre
2011-04-29 0:31 ` Vincent Lefevre
2011-04-29 0:59 ` Vincent Lefevre
2011-04-29 1:34 ` Vincent Lefevre
2011-04-29 3:56 ` Bart Schaefer
2011-04-29 8:44 ` Vincent Lefevre
2011-04-29 11:15 ` Vincent Lefevre
2011-05-04 9:33 ` Vincent Lefevre
2011-04-29 14:20 ` Bart Schaefer [this message]
2011-05-02 8:08 ` Vincent Lefevre
2011-05-02 8:34 ` Vincent Lefevre
2011-05-02 11:54 ` Peter Stephenson
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=110429072032.ZM13518@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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 NNTP newsgroup(s).