Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 3/3] Constify two local variables.
- X-seq: zsh-workers 37258
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH 3/3] Constify two local variables.
- Date: Mon, 30 Nov 2015 08:28:38 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=2bSfiGeQ02PUe4kmq+6OqOhnmqBPthkJ70QdNK2lVWg=; b=a+O03odX6r6lxmwtI/fmqaN9DSoCDdtFWMhCejHpg7J61E/OShBmCtoFLVpnUtj90H EQAjGkxNZi33rXteKpDsLt71UNVM1NLcVJCtdqa5pLMGwdICBwuW224U5eG/0hkZ381A s2iMD8WU/oGr43jrxCSretpx/bhnKYsc/uf1+yR0KyMXrGCdTdmvUAgSPtxYucRHeSmB n9FYYjN+7NTEm0QN/N2ZQMJsNzwX1A0wMu1vnz5f7Cxk8HpzEtpWU3AZORg8BzEw07w0 rZMvjDG9QBzphpJgkumlKK+u6nUqy6PCtsgsN1+8D4k9KIxFFX/kEsnYy7Tp0GVmsP8g 1PZw==
- In-reply-to: <20151130155945.GD10968@tarsus.local2>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20151130032153.GH2504@tarsus.local2> <20151130093832.5321126d@pwslap01u.europe.root.pri> <20151130155945.GD10968@tarsus.local2>
On Nov 30, 3:59pm, Daniel Shahaf wrote:
}
} I'm asking because I found that $region_highlights' getfn returns
} a heap-allocated array, while its setfn calls free() on the array passed
} to it, so
} .
} Param pm = $region_highlights;
} values_a = pm->gsu.a->getfn();
} pm->gsu.a->setfn(values_a);
} .
} is undefined behaviour (calls free() on a heap pointer, triggering SIGABRT).
In general you can't pass the result of any getfn() back to its own
or anyone else's setfn(). All setfn() should always expect a newly-
zshcalloc()d [or the equivalent] array.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author