Skip to content

Commit

Permalink
fix apply on user-defined aggregate init (souffle-lang#2456)
Browse files Browse the repository at this point in the history
The `init` expression of user-define aggregates was never
handed-over to `apply`'s `mapper`.

One visible issue is that the `TupleId` transformer would not update the
tuple of the `init` expression while shuffling tuple identifiers.
That would then result in the `init` expression peeking data in the
wrong tuple during execution of the RAM program.
  • Loading branch information
quentin committed Jun 11, 2024
1 parent f1c664a commit d99c00c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ram/Aggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class Aggregate : public RelationOperation, public AbstractAggregate {
for (auto &elem : orderBy) {
elem->expr = map(std::move(elem->expr));
}
function->apply(map);
}

static bool classof(const Node* n) {
Expand Down
1 change: 1 addition & 0 deletions src/ram/IndexAggregate.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class IndexAggregate : public IndexOperation, public AbstractAggregate {
for (auto &elem : orderBy) {
elem->expr = map(std::move(elem->expr));
}
function->apply(map);
}

static bool classof(const Node* n) {
Expand Down

0 comments on commit d99c00c

Please sign in to comment.