diff --git a/CHANGES b/CHANGES index c3a9f10f02..365edc0d4d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,16 @@ +7.1.0-dev.428 | 2024-10-29 13:50:05 +0100 + + * fixed "-O gen-C++" naming of "when" captures to avoid ambiguities due to inlining (Vern Paxson, Corelight) + + Previously there was logic for doing this, but it was ineffectual + due to the order in which canonicalization was done. This problem + manifested non-deterministically depending on order-of-generation + of "when" lambdas, which is why previous testing didn't catch it. + + * Simplified & made more robust maintenance helper script for "-O gen-C++" testing (Vern Paxson, Corelight) + + * "-a cpp" baseline updates to reflect recent BTest changes (Vern Paxson, Corelight) + 7.1.0-dev.423 | 2024-10-24 07:08:45 -0700 * Telemetry framework: move BIFs to the primary-bif stage (Christian Kreibich, Corelight) diff --git a/VERSION b/VERSION index 1d359bcf23..cef8d462ce 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.1.0-dev.423 +7.1.0-dev.428 diff --git a/src/script_opt/CPP/Vars.cc b/src/script_opt/CPP/Vars.cc index 4413395304..bdbf62e8ac 100644 --- a/src/script_opt/CPP/Vars.cc +++ b/src/script_opt/CPP/Vars.cc @@ -133,15 +133,13 @@ string CPPCompile::LocalName(const ID* l) const { return Canonicalize(trim_name( string CPPCompile::CaptureName(const ID* c) const { // We want to strip both the module and any inlining appendage. - auto n = Canonicalize(trim_name(c).c_str()); + auto tn = trim_name(c); - auto appendage = n.find("."); - if ( appendage != string::npos ) { - n.erase(n.begin() + appendage, n.end()); - n.push_back('_'); - } + auto appendage = tn.find("."); + if ( appendage != string::npos ) + tn.erase(tn.begin() + appendage, tn.end()); - return n; + return Canonicalize(tn.c_str()); } string CPPCompile::Canonicalize(const char* name) const { diff --git a/src/script_opt/CPP/maint/find-test-files.sh b/src/script_opt/CPP/maint/find-test-files.sh index c5adfe4e33..642b438d31 100755 --- a/src/script_opt/CPP/maint/find-test-files.sh +++ b/src/script_opt/CPP/maint/find-test-files.sh @@ -1,10 +1,9 @@ #! /bin/sh find ../testing/btest -type f | - grep -E -v 'Baseline|\.tmp|__load__' | - grep -E '\.(zeek|test)$' | - sort | + xargs grep -E -l '@TEST' | xargs grep -E -l '^[ ]*(event|print)' | xargs grep -E -c 'REQUIRES.*CPP.*((!=.*1)|(==.*0))' | grep ':0$' | - sed 's,:0,,' + sed 's,:0,,' | + sort diff --git a/testing/btest/Baseline.cpp/core.max-analyzer-violations/weird.log b/testing/btest/Baseline.cpp/core.max-analyzer-violations/weird.log index 99b5e14621..8d0cb822e6 100644 --- a/testing/btest/Baseline.cpp/core.max-analyzer-violations/weird.log +++ b/testing/btest/Baseline.cpp/core.max-analyzer-violations/weird.log @@ -7,7 +7,7 @@ #open XXXX-XX-XX-XX-XX-XX #fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p name addl notice peer source #types time string addr port addr port string string bool string string -XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 127.0.0.1 58246 127.0.0.1 110 pop3_server_command_unknown - F zeek POP3 +XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 127.0.0.1 58246 127.0.0.1 110 pop3_server_command_unknown + F zeek POP3 XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 127.0.0.1 58246 127.0.0.1 110 line_terminated_with_single_CR - F zeek CONTENTLINE XXXXXXXXXX.XXXXXX CHhAvVGS1DHFjwGM9 127.0.0.1 58246 127.0.0.1 110 too_many_analyzer_violations - F zeek POP3 #close XXXX-XX-XX-XX-XX-XX diff --git a/testing/btest/Baseline.cpp/language.sizeof/output b/testing/btest/Baseline.cpp/language.sizeof/output index 0982d6914a..cbb6540cbb 100644 --- a/testing/btest/Baseline.cpp/language.sizeof/output +++ b/testing/btest/Baseline.cpp/language.sizeof/output @@ -7,11 +7,13 @@ Expr: 18446744073709551612 Signed Expr: 4 Double -1.23: 1.230000 Enum ENUM3: 2 +Enum in record: 2 2 File 21.000000 Function add_interface: 2 Integer -10: 10 Interval -5.0 secs: 5.000000 Port 80/tcp: 65616 +Port in record: 65616 65616 Record [i=10, j=, k=]: 3 Set: 3 String 'Hello': 5