From 1c74ea788532848ffee577191a4d6cace941453b Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 12 Aug 2020 14:58:43 +1000 Subject: [PATCH] fixed silly issue with index calculation in synthesiser for type info --- src/synthesiser/SynthesiserRelation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/synthesiser/SynthesiserRelation.cpp b/src/synthesiser/SynthesiserRelation.cpp index d6608358323..a2315e94b78 100644 --- a/src/synthesiser/SynthesiserRelation.cpp +++ b/src/synthesiser/SynthesiserRelation.cpp @@ -233,7 +233,7 @@ void SynthesiserDirectRelation::generateTypeStruct(std::ostream& out) { out << " return "; std::function gencmp = [&](size_t i) { size_t attrib = ind[i]; - const auto& typecast = typecasts[i]; + const auto& typecast = typecasts[attrib]; out << "(" << typecast << "(a[" << attrib << "]) < " << typecast << "(b[" << attrib << "])) ? -1 : (" << typecast << "(a[" << attrib << "]) > " << typecast << "(b[" << attrib @@ -251,7 +251,7 @@ void SynthesiserDirectRelation::generateTypeStruct(std::ostream& out) { out << " return "; std::function genless = [&](size_t i) { size_t attrib = ind[i]; - const auto& typecast = typecasts[i]; + const auto& typecast = typecasts[attrib]; out << "(" << typecast << "(a[" << attrib << "]) < " << typecast << "(b[" << attrib << "]))"; if (i + 1 < bound) { @@ -267,7 +267,7 @@ void SynthesiserDirectRelation::generateTypeStruct(std::ostream& out) { out << "return "; std::function geneq = [&](size_t i) { size_t attrib = ind[i]; - const auto& typecast = typecasts[i]; + const auto& typecast = typecasts[attrib]; out << "(" << typecast << "(a[" << attrib << "]) == " << typecast << "(b[" << attrib << "]))"; if (i + 1 < bound) {