Skip to content

Conversation

kkysen
Copy link
Contributor

@kkysen kkysen commented Sep 19, 2025

Right now, we sort the top-level decls once by their source order (although we do this largely backwards, a separate issue) before we convert them and then emit them (insert in the code). This means that changing the conversion order also changes the order that they're emitted in, which we don't want to do, so this separates the two steps.

@fw-immunant
Copy link
Contributor

Interesting, the testsuite failure shows us rewriting an expansion of the NTLMv2_BLOB_LEN macro, but we shouldn't be treating this macro as successfully converted to a const because it references a free (at the definition site) variable:

#define NTLMv2_BLOB_LEN       (44 -16 + ntlm->target_info_len + 4)

Base automatically changed from kkysen/simplifications-before-const-macros-override_tys to master September 19, 2025 16:10
@kkysen kkysen force-pushed the kkysen/independent-top-decls-sort-order branch from 793e6c7 to 98e803b Compare September 22, 2025 05:07
Copy link
Contributor Author

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, the testsuite failure shows us rewriting an expansion of the NTLMv2_BLOB_LEN macro, but we shouldn't be treating this macro as successfully converted to a const because it references a free (at the definition site) variable

Yeah, and I'm not sure why changing the order affects this. Still looking into it...

@kkysen kkysen force-pushed the kkysen/independent-top-decls-sort-order branch from 98e803b to 3620fdd Compare September 27, 2025 07:21
kkysen added a commit that referenced this pull request Oct 2, 2025
Determining which declarations have been declared within the scope of
the const macro expr vs. which are out-of-scope of the const macro is
non-trivial, so for now, we don't allow const macros referencing any
declarations.

This should fix some of the issues surfaced in #1371 when the order of
top-level decl being converted was changed.
@kkysen kkysen force-pushed the kkysen/independent-top-decls-sort-order branch from 3620fdd to 850118b Compare October 2, 2025 22:29
kkysen added 3 commits October 7, 2025 17:03
…tted code)

This sets things up to iterate through different orders for each.
…efore they're inserted

This should ensure that those two steps are properly separated.
@kkysen kkysen force-pushed the kkysen/independent-top-decls-sort-order branch from 850118b to b85ef7b Compare October 8, 2025 00:03
Copy link
Contributor Author

@kkysen kkysen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, the testsuite failure shows us rewriting an expansion of the NTLMv2_BLOB_LEN macro, but we shouldn't be treating this macro as successfully converted to a const because it references a free (at the definition site) variable:

#define NTLMv2_BLOB_LEN       (44 -16 + ntlm->target_info_len + 4)

This should be skipped by #1387, so merging this now.

@kkysen kkysen merged commit 9edc1ed into master Oct 8, 2025
5 checks passed
@kkysen kkysen deleted the kkysen/independent-top-decls-sort-order branch October 8, 2025 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants