Skip to content

Commit

Permalink
fixed silly issue with index calculation in synthesiser for type info
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam committed Aug 12, 2020
1 parent 01fab76 commit 1c74ea7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/synthesiser/SynthesiserRelation.cpp
Expand Up @@ -233,7 +233,7 @@ void SynthesiserDirectRelation::generateTypeStruct(std::ostream& out) {
out << " return ";
std::function<void(size_t)> 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
Expand All @@ -251,7 +251,7 @@ void SynthesiserDirectRelation::generateTypeStruct(std::ostream& out) {
out << " return ";
std::function<void(size_t)> 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) {
Expand All @@ -267,7 +267,7 @@ void SynthesiserDirectRelation::generateTypeStruct(std::ostream& out) {
out << "return ";
std::function<void(size_t)> 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) {
Expand Down

0 comments on commit 1c74ea7

Please sign in to comment.