bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#43725: 28.0.50; Include feature/native-comp into master


From: Andrea Corallo
Subject: bug#43725: 28.0.50; Include feature/native-comp into master
Date: Thu, 18 Feb 2021 21:22:54 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: larsi@gnus.org, monnier@iro.umontreal.ca, 43725@debbugs.gnu.org
>> Date: Tue, 16 Feb 2021 21:13:07 +0000
>> 
>> Addressing some easy part of the review to close the day.
>
> Thanks.
>
>> > Likewise, this is unsafe because a fixnum can be larger than INT_MAX:
>> >
>> >   +  if (!FIXNUMP (idx))
>> >   +    xsignal1 (Qnative_ice,
>> >   +             build_string ("inconsistent data relocation container"));
>> >   +  reloc.idx = gcc_jit_context_new_rvalue_from_int (comp.ctxt,
>> >   +                                                  comp.ptrdiff_type,
>> >   +                                                  XFIXNUM (idx)); 
>> > <<<<<<<<
>> >
>> > (There are several more calls with the same problem.)
>> 
>> Should we never trust in C a value coming from a Lisp_Object even if is
>> supposed to be constructed on purpose?
>
> We can trust that if we indeed make the value explicitly, but if
> there's at least a tiny chance to get a value that's too large, at
> least an assertion would be a good idea.

That's sensible.  185121da69 and b1bab6e073 are introducing assertions
for the highlighted cases and the other one I've spotted.

Thanks

  Andrea





reply via email to

[Prev in Thread] Current Thread [Next in Thread]