summaryrefslogtreecommitdiff
path: root/regen/embed.pl
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2023-01-31 05:09:43 +0100
committerYves Orton <demerphq@gmail.com>2023-02-19 11:27:50 +0800
commitd6a7165bd44b5bdf2dc544680b8f167b6ad3351f (patch)
treed596453e74e8f1f140e5cce3eabbbf4cdf0ec5e4 /regen/embed.pl
parentb8837dad4db9806bc61659d5230a35b90655c07b (diff)
downloadperl-d6a7165bd44b5bdf2dc544680b8f167b6ad3351f.tar.gz
embed.pl - sort and dedupe flags in embef.fnc as part of tidy
This ensures we use a canonical string for each possible flag variant, which makes it easier to search for flags with a given flag signature. It also exposed a mutex bug in flag handling which caused PerlEnv_putenv to be improperly marked as static, when it is in fact static inline. To validate there aren't any issues like this remaining in the script I set it up so the flags were shuffled during processing and ran embed.pl in a loop for a while and none of the output files changed, so I assume there are no further such issues. This patch also includes some basic validation of the flags so that if someone misses a line continuation the following lines are not treated as a new definition without any flags. I also ran perltidy on it according to the rules contained within the file.
Diffstat (limited to 'regen/embed.pl')
-rwxr-xr-xregen/embed.pl7
1 files changed, 1 insertions, 6 deletions
diff --git a/regen/embed.pl b/regen/embed.pl
index 81798816de..1c2fe4a5f9 100755
--- a/regen/embed.pl
+++ b/regen/embed.pl
@@ -128,12 +128,7 @@ sub generate_proto_h {
die_at_end "$plain_func: u flag only usable with m" if $flags =~ /u/
&& $flags !~ /m/;
- my ($static_flag, @extra_static_flags)= do {
- # the seen filter can be removed once flag dedupe
- # is done in tidy_embed.pl
- my %seen;
- grep !$seen{$_}++, $flags =~/([SsIi])/g;
- };
+ my ($static_flag, @extra_static_flags)= $flags =~/([SsIi])/g;
if (@extra_static_flags) {
my $flags_str = join ", ", $static_flag, @extra_static_flags;