Fix segmentation fault bug introduced by previous commit
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 25 Jan 2017 18:22:41 +0000
changeset 1029 37145f381bb0
parent 1028 7c8709ce6b8f
child 1030 9aba95daf81a
Fix segmentation fault bug introduced by previous commit
stage3/narrow_candidate_datatypes.cc
--- a/stage3/narrow_candidate_datatypes.cc	Tue Jan 24 12:44:44 2017 +0000
+++ b/stage3/narrow_candidate_datatypes.cc	Wed Jan 25 18:22:41 2017 +0000
@@ -932,11 +932,13 @@
 
 
 void *narrow_candidate_datatypes_c::visit(action_qualifier_c *symbol) {
-	for(unsigned int i = 0; i < symbol->action_time->candidate_datatypes.size(); i++) {
-		if (get_datatype_info_c::is_TIME_compatible(symbol->action_time->candidate_datatypes[i]))
-			symbol->action_time->datatype = symbol->action_time->candidate_datatypes[i];
-	}
-	symbol->action_time->accept(*this);
+	if (symbol->action_time) {
+		for(unsigned int i = 0; i < symbol->action_time->candidate_datatypes.size(); i++) {
+			if (get_datatype_info_c::is_TIME_compatible(symbol->action_time->candidate_datatypes[i]))
+				symbol->action_time->datatype = symbol->action_time->candidate_datatypes[i];
+		}
+		symbol->action_time->accept(*this);
+	}
 	symbol->action_qualifier->accept(*this); // Not really necessary for now...
 	return NULL;
 }