From 87315038aad809dd901339aae99d4ca62611692f Mon Sep 17 00:00:00 2001 From: Botond Baranyi <botond.baranyi@ericsson.com> Date: Mon, 9 Nov 2020 17:54:36 +0100 Subject: [PATCH] Fixed merging of set elements in universal charstring pattern subtyping (bug 568592) Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com> Change-Id: I6e92fa29e07532caa01914f5bdf26771d1cd5813 --- common/Quadruple.cc | 1 + .../compileonly/Bug568592/.gitignore | 4 ++ .../compileonly/Bug568592/Bug568592.ttcn | 19 +++++++ .../compileonly/Bug568592/Makefile | 50 +++++++++++++++++++ regression_test/compileonly/Makefile | 2 +- 5 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 regression_test/compileonly/Bug568592/.gitignore create mode 100644 regression_test/compileonly/Bug568592/Bug568592.ttcn create mode 100644 regression_test/compileonly/Bug568592/Makefile diff --git a/common/Quadruple.cc b/common/Quadruple.cc index c215a60b7..0dc6a3846 100644 --- a/common/Quadruple.cc +++ b/common/Quadruple.cc @@ -431,6 +431,7 @@ void QuadSet::add(QuadInterval* interval) { if (it == set) set = it->next; quadset_node_t* p = it; + it_old->next = it->next; it = it->next; delete p; continue; diff --git a/regression_test/compileonly/Bug568592/.gitignore b/regression_test/compileonly/Bug568592/.gitignore new file mode 100644 index 000000000..a44ccf1fe --- /dev/null +++ b/regression_test/compileonly/Bug568592/.gitignore @@ -0,0 +1,4 @@ +Bug568592 +Bug568592.exe +Bug568592*.cc +Bug568592*.hh diff --git a/regression_test/compileonly/Bug568592/Bug568592.ttcn b/regression_test/compileonly/Bug568592/Bug568592.ttcn new file mode 100644 index 000000000..c7e6d5af7 --- /dev/null +++ b/regression_test/compileonly/Bug568592/Bug568592.ttcn @@ -0,0 +1,19 @@ +/****************************************************************************** + * Copyright (c) 2000-2020 Ericsson Telecom AB + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html + * + * Contributors: + * Baranyi, Botond + * + ******************************************************************************/ + +// pattern subtyping, where a single elment in a set is followed by +// an interval that contains the single element (bug 568592) +module Bug568592 { + +type universal charstring T (pattern "[a-zA-Z\q{0, 0, 0, 38}&-;]"); + +} diff --git a/regression_test/compileonly/Bug568592/Makefile b/regression_test/compileonly/Bug568592/Makefile new file mode 100644 index 000000000..15d3ca9b6 --- /dev/null +++ b/regression_test/compileonly/Bug568592/Makefile @@ -0,0 +1,50 @@ +############################################################################## +# Copyright (c) 2000-2020 Ericsson Telecom AB +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html +# +# Contributors: +# Botond, Baranyi +# +############################################################################## +TOPDIR := ../.. +include $(TOPDIR)/Makefile.regression + +.PHONY: all clean dep + +TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX) + +TTCN3_MODULES = Bug568592.ttcn + +GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) +GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh) +ifdef CODE_SPLIT +GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc)) +else ifdef SPLIT_TO_SLICES +POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_)) +POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc)) +GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES))) +GENERATED_SOURCES += $(GENERATED_SOURCES2) +endif + +OBJECTS = $(GENERATED_SOURCES:.cc=.o) + +TARGET = Bug568592$(EXESUFFIX) + +all: $(TARGET) + +$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES) + $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \ + -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS) + +$(GENERATED_SOURCES) $(GENERATED_HEADERS): $(TTCN3_MODULES) + $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ + +clean distclean: + $(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ + $(GENERATED_SOURCES) compile *.log + +dep: $(GENERATED_SOURCES) + makedepend $(CPPFLAGS) $(GENERATED_SOURCES) diff --git a/regression_test/compileonly/Makefile b/regression_test/compileonly/Makefile index cf0922753..8b3f220e2 100644 --- a/regression_test/compileonly/Makefile +++ b/regression_test/compileonly/Makefile @@ -31,7 +31,7 @@ CODIRS := dynamicTemplate styleGuide topLevelPdu \ asn1_hyphen nameClash portTranslation UntaggedOnTopLevelUnionSwitch \ typeDescrGenWIthNoXER languageSpec asn1_opentype openTypeXER \ asnStringSubtypes componentParameter realtimeKeywords Bug550526 \ - Bug550623 Bug552232 Bug568340 + Bug550623 Bug552232 Bug568340 Bug568592 ifdef DYN CODIRS += mfgen-xsd -- GitLab