Skip to content

Commit b99fb05

Browse files
authored
Merge pull request #48 from tudelft-cda-lab/fixed_satsolver_and_json_parsing
Fixed missing nullptr check causing segfaults, fixed merging with roo…
2 parents 28250b5 + 8052622 commit b99fb05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

source/dfasat.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void dfasat::fix_red_values(){
321321

322322
for(int label = 0; label < alphabet_size; ++label){
323323
apta_node* target = node->get_child(label);
324-
if(target->is_red() == true){
324+
if(target != nullptr && target->is_red() == true){
325325
int tcr = state_colour[target];
326326

327327
for(int i = 0; i < dfa_size; ++i) y[label][cr][i] = -2;
@@ -1137,6 +1137,7 @@ void dfasat::translate(FILE* sat_file) {
11371137
void dfasat::perform_sat_merges(state_merger* m) {
11381138
std::map<int,apta_node*> color_node;
11391139
apta* aut = m->get_aut();
1140+
color_node[0] = aut->get_root();
11401141
bool did_merge = true;
11411142
while(did_merge){
11421143
did_merge = false;
@@ -1157,6 +1158,7 @@ void dfasat::perform_sat_merges(state_merger* m) {
11571158
}
11581159

11591160
if(cr == -1) continue;
1161+
11601162
if(!color_node.contains(cr)) {
11611163
m->extend(blue);
11621164
color_node[cr] = blue;

0 commit comments

Comments
 (0)