GNU bug report logs - #46670
28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode

Previous Next

Package: emacs;

Reported by: Mauricio Collares <mauricio <at> collares.org>

Date: Sun, 21 Feb 2021 00:14:02 UTC

Severity: normal

Found in version 28.0.50

Done: Andrea Corallo <akrl <at> sdf.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrea Corallo <akrl <at> sdf.org>
To: Pip Cet <pipcet <at> gmail.com>
Cc: 46670 <at> debbugs.gnu.org, Mauricio Collares <mauricio <at> collares.org>
Subject: bug#46670: 28.0.50; [feature/native-comp] possible miscompilation affecting lsp-mode
Date: Mon, 22 Feb 2021 13:12:36 +0000
Pip Cet <pipcet <at> gmail.com> writes:

> On Mon, Feb 22, 2021 at 11:23 AM Andrea Corallo <akrl <at> sdf.org> wrote:
>> Pip Cet <pipcet <at> gmail.com> writes:
>> > On Mon, Feb 22, 2021 at 10:04 AM Pip Cet <pipcet <at> gmail.com> wrote:
>> > (Except for this one:
>> >
>> >       ((defun comp-tests-ret-type-spec-f (x)
>> >          (unless (symbolp x)
>> >            x))
>> >        (not symbol))
>> >
>> > If I'm reading that correctly, it tests that (unless (symbolp x) x)
>> > isn't a symbol, which it usually is)
>>
>> Yep, it verifies that this function has as inferred return type (not
>> symbol).
>
> Which means the return value shouldn't ever be a symbol, right?
> Because it's nil, which is a symbol, when (symbolp x). Am I missing
> something here?

Sorry I though the question was on the test mechanism and wasn't pay
attention to the specific testcase content :/

Right that's clearly a bug in `comp-cstr-union-1-no-mem' that was
missing to check that no negative type is shadowing any positive type
coming from values and giving-up returning t in case).

Good catch thanks! :) Should be fixed by d6227f6edc.

  Andrea

PS as I see you are interested into this part of the compiler, I find
typically handy to exercise this logic with like:

(let ((comp-ctxt (make-comp-cstr-ctxt)))
  (comp-cstr-to-type-spec
   (comp-type-spec-to-cstr '(or (not symbol) null))))

We'll probably see other bugs in this area cause is tricky, is important
we build the best coverage we can for this in the testsuite.




This bug report was last modified 4 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.