From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18856 invoked by alias); 5 Mar 2017 22:45:48 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40747 Received: (qmail 3974 invoked from network); 5 Mar 2017 22:45:48 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.28):SA:0(-0.7/5.0):. Processed in 1.923338 secs); 05 Mar 2017 22:45:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=MieU4VCCfrkl75s NUtVnxSizU+A=; b=Wv0AWMIPzo6rgtjqvtjLpAZF2QnKDRLCZAOrniHU/flEln7 6wsDi+pXExOTtPX8AnTiMShF45XccBZmuW/HFfSZuKOBr9VEeXBTEJlmZo3vS3w8 0jxqHD7agNdnCRvSm7Jkw4q4k2AOYLBCqHGh9WxirsZpJIYTKA4E0FzAyank= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=MieU4VCCfrkl75 sNUtVnxSizU+A=; b=S6R9iiHJUG4AFcEi8E1qbu68jrtAxSEchBaQHvoAx4vGZ0 0ii6euF4gCu6jt9iiwdAGmlHRGFD15jNDmZxzrcKJAIuDK7PnKq0U8RY+VpgcOsj rcetLgEIAvQYiBj36zt0e85D+T8xZPj0lLPmU//hwL1pz877N+YExEH41onrU= X-ME-Sender: X-Sasl-enc: +ul6Jvaa9QjsjpkRmXMPxgT9zbK7eED/IwTJB1GWfhUf 1488753943 Date: Sun, 5 Mar 2017 22:41:00 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: [BUG] SIGSEGV under certain circumstances Message-ID: <20170305224100.GA18432@fujitsu.shahaf.local2> References: <170304151137.ZM30694@torch.brasslantern.com> <170305080054.ZM24832@torch.brasslantern.com> <20170305161720.6f3773d6@ntlworld.com> <170305104239.ZM25231@torch.brasslantern.com> <5096E600-D76C-4F71-BE93-C46F256BA7D7@ntlworld.com> <170305134513.ZM26364@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170305134513.ZM26364@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Sun, Mar 05, 2017 at 13:45:13 -0800: > [Somebody will have to explain to me why (mp += cl) makes sense, as that > seems to be using a byte count to increment a (Cmatcher*), but it's done > in several places.] [ Context: this is about cfp_matcher_pats(). ] Using a byte count to modify a pointer, in itself, is fine. It's just pointer arithmetic that makes the pointer 'mp' point at a different element of the array 'ms'. The part that confuses me is why the line says 'mp += cl' rather than simply 'mp++'. The inner loop executes precisely 'zl' times (because the loop variable, 'tl', is initialized to 'al' and skips Meta bytes), and 'mp' points into an array of size 'zl'.