From 9ff78da69a64c2c4a7201ecff7667c74d5b6c878 Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 6 Dec 2024 16:16:35 -0800 Subject: [PATCH] modified merge_types() to skip work if given identical types, which also preserves type names (useful for -O gen-C++) (cherry picked from commit 7ed3f79c87f2cda1fde37b3fc6b6e272360e3b3d) --- CHANGES | 7 +++++++ VERSION | 2 +- src/Type.cc | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 6f2464c68e..3a4ee23983 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,10 @@ +7.0.9-2 | 2025-08-22 13:02:51 -0700 + + * modified merge_types() to skip work if given identical types, which (Vern Paxson, Corelight) + also preserves type names (useful for -O gen-C++) + + (cherry picked from commit 7ed3f79c87f2cda1fde37b3fc6b6e272360e3b3d) + 7.0.9-1 | 2025-08-22 13:00:59 -0700 * smb2/read: Parse only 1 byte for data_offset, ignore reserved1 (Arne Welzel, Corelight) diff --git a/VERSION b/VERSION index 77e6b809ce..bd09fb0659 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -7.0.9-1 +7.0.9-2 diff --git a/src/Type.cc b/src/Type.cc index 5341476a3f..9a1b1e6726 100644 --- a/src/Type.cc +++ b/src/Type.cc @@ -2357,6 +2357,9 @@ TypeListPtr merge_list_types(const Type* t1, const Type* t2) { } TypePtr merge_types(const TypePtr& arg_t1, const TypePtr& arg_t2) { + if ( arg_t1 == arg_t2 ) + return arg_t1; + auto t1 = arg_t1.get(); auto t2 = arg_t2.get(); // t1 = flatten_type(t1);