Merge lp:~tapaal-ltl/verifypn/fireable-empty-preset-fix into lp:verifypn

Proposed by Nikolaj Jensen Ulrik
Status: Merged
Approved by: Jiri Srba
Approved revision: 248
Merged at revision: 248
Proposed branch: lp:~tapaal-ltl/verifypn/fireable-empty-preset-fix
Merge into: lp:verifypn
Diff against target: 13 lines (+3/-0)
1 file modified
src/PetriEngine/PQL/Expressions.cpp (+3/-0)
To merge this branch: bzr merge lp:~tapaal-ltl/verifypn/fireable-empty-preset-fix
Reviewer Review Type Date Requested Status
Jiri Srba Approve
Peter Gjøl Jensen Approve
Review via email: mp+407243@code.launchpad.net

Description of the change

When unfolding is-fireable(t) for t with empty preset, it becomes an AndCondition with no conditions, causing a segmentation fault when attempting to interact with it. This patch instead inserts True in that case, assuming an empty preset transition is always enabled.

To post a comment you must log in.
Revision history for this message
Peter Gjøl Jensen (peter-gjoel) wrote :

LGTM.

review: Approve
Revision history for this message
Jiri Srba (srba) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/PetriEngine/PQL/Expressions.cpp'
2--- src/PetriEngine/PQL/Expressions.cpp 2021-07-07 13:19:23 +0000
3+++ src/PetriEngine/PQL/Expressions.cpp 2021-08-17 09:51:58 +0000
4@@ -446,6 +446,9 @@
5 }
6 }
7 if(conds.size() == 1) _compiled = conds[0];
8+ else if (conds.empty()) {
9+ _compiled = BooleanCondition::TRUE_CONSTANT;
10+ }
11 else _compiled = std::make_shared<AndCondition>(conds);
12 _compiled->analyze(context);
13 }

Subscribers

People subscribed via source and target branches