* Re: feature/asan-gc-poisoning aa9ca2c1493 2/2: src/alloc.c: Fix incorrect pointer arithmetic.
[not found] ` <20221204171657.3636BC00B0F@vcs2.savannah.gnu.org>
@ 2022-12-05 1:13 ` Po Lu
2022-12-05 13:06 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Po Lu @ 2022-12-05 1:13 UTC (permalink / raw)
To: emacs-devel; +Cc: Vibhav Pant
Vibhav Pant <vibhavp@gmail.com> writes:
> branch: feature/asan-gc-poisoning
> commit aa9ca2c1493f1cd9d50698747fd054b1be53dc95
> Author: Vibhav Pant <vibhavp@gmail.com>
> Commit: Vibhav Pant <vibhavp@gmail.com>
>
> src/alloc.c: Fix incorrect pointer arithmetic.
>
> * src/alloc.c (live_float_holding): Use parenthesis around the
> pointer arithmetic expression to untag 'cp' correctly.
> ---
> src/alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/alloc.c b/src/alloc.c
> index 31108837e5a..6b8a4cdcc02 100644
> --- a/src/alloc.c
> +++ b/src/alloc.c
> @@ -5104,7 +5104,7 @@ live_float_holding (struct mem_node *m, void *p)
> && (b != float_block
> || offset / sizeof b->floats[0] < float_block_index))
> {
> - struct Lisp_Float *f = (struct Lisp_Float *) cp - off;
> + struct Lisp_Float *f = (struct Lisp_Float *) (cp - off);
> #if GC_ASAN_POISON_OBJECTS
> if (__asan_region_is_poisoned (f, sizeof (*f)))
> return NULL;
This is a problem on master and emacs-29 too, right?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: feature/asan-gc-poisoning aa9ca2c1493 2/2: src/alloc.c: Fix incorrect pointer arithmetic.
2022-12-05 1:13 ` feature/asan-gc-poisoning aa9ca2c1493 2/2: src/alloc.c: Fix incorrect pointer arithmetic Po Lu
@ 2022-12-05 13:06 ` Eli Zaretskii
2022-12-05 20:01 ` Vibhav Pant
0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2022-12-05 13:06 UTC (permalink / raw)
To: Po Lu; +Cc: emacs-devel, vibhavp
> From: Po Lu <luangruo@yahoo.com>
> Cc: Vibhav Pant <vibhavp@gmail.com>
> Date: Mon, 05 Dec 2022 09:13:59 +0800
>
> Vibhav Pant <vibhavp@gmail.com> writes:
>
> > branch: feature/asan-gc-poisoning
> > commit aa9ca2c1493f1cd9d50698747fd054b1be53dc95
> > Author: Vibhav Pant <vibhavp@gmail.com>
> > Commit: Vibhav Pant <vibhavp@gmail.com>
> >
> > src/alloc.c: Fix incorrect pointer arithmetic.
> >
> > * src/alloc.c (live_float_holding): Use parenthesis around the
> > pointer arithmetic expression to untag 'cp' correctly.
> > ---
> > src/alloc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/alloc.c b/src/alloc.c
> > index 31108837e5a..6b8a4cdcc02 100644
> > --- a/src/alloc.c
> > +++ b/src/alloc.c
> > @@ -5104,7 +5104,7 @@ live_float_holding (struct mem_node *m, void *p)
> > && (b != float_block
> > || offset / sizeof b->floats[0] < float_block_index))
> > {
> > - struct Lisp_Float *f = (struct Lisp_Float *) cp - off;
> > + struct Lisp_Float *f = (struct Lisp_Float *) (cp - off);
> > #if GC_ASAN_POISON_OBJECTS
> > if (__asan_region_is_poisoned (f, sizeof (*f)))
> > return NULL;
>
> This is a problem on master and emacs-29 too, right?
I don't think so: there are no such code on those two branches, AFAICT.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: feature/asan-gc-poisoning aa9ca2c1493 2/2: src/alloc.c: Fix incorrect pointer arithmetic.
2022-12-05 13:06 ` Eli Zaretskii
@ 2022-12-05 20:01 ` Vibhav Pant
0 siblings, 0 replies; 3+ messages in thread
From: Vibhav Pant @ 2022-12-05 20:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Po Lu, emacs-devel
Yup, this shouldn't be needed for either branches. I had added the
additional variable to aid readability with __asan_region_is_poisoned.
Thanks,
Vibhav
On Mon, Dec 5, 2022 at 6:36 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Po Lu <luangruo@yahoo.com>
> > Cc: Vibhav Pant <vibhavp@gmail.com>
> > Date: Mon, 05 Dec 2022 09:13:59 +0800
> >
> > Vibhav Pant <vibhavp@gmail.com> writes:
> >
> > > branch: feature/asan-gc-poisoning
> > > commit aa9ca2c1493f1cd9d50698747fd054b1be53dc95
> > > Author: Vibhav Pant <vibhavp@gmail.com>
> > > Commit: Vibhav Pant <vibhavp@gmail.com>
> > >
> > > src/alloc.c: Fix incorrect pointer arithmetic.
> > >
> > > * src/alloc.c (live_float_holding): Use parenthesis around the
> > > pointer arithmetic expression to untag 'cp' correctly.
> > > ---
> > > src/alloc.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/src/alloc.c b/src/alloc.c
> > > index 31108837e5a..6b8a4cdcc02 100644
> > > --- a/src/alloc.c
> > > +++ b/src/alloc.c
> > > @@ -5104,7 +5104,7 @@ live_float_holding (struct mem_node *m, void *p)
> > > && (b != float_block
> > > || offset / sizeof b->floats[0] < float_block_index))
> > > {
> > > - struct Lisp_Float *f = (struct Lisp_Float *) cp - off;
> > > + struct Lisp_Float *f = (struct Lisp_Float *) (cp - off);
> > > #if GC_ASAN_POISON_OBJECTS
> > > if (__asan_region_is_poisoned (f, sizeof (*f)))
> > > return NULL;
> >
> > This is a problem on master and emacs-29 too, right?
>
> I don't think so: there are no such code on those two branches, AFAICT.
--
Vibhav Pant
vibhavp@gmail.com
GPG: 7ED1 D48C 513C A024 BE3A 785F E3FB 28CB 6AB5 9598
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-05 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <167017421615.20730.5839006885061308371@vcs2.savannah.gnu.org>
[not found] ` <20221204171657.3636BC00B0F@vcs2.savannah.gnu.org>
2022-12-05 1:13 ` feature/asan-gc-poisoning aa9ca2c1493 2/2: src/alloc.c: Fix incorrect pointer arithmetic Po Lu
2022-12-05 13:06 ` Eli Zaretskii
2022-12-05 20:01 ` Vibhav Pant
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).