Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit c536259

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
[NF] Call fail() when failing
This avoids segmentation faults due to the type checking returning types even when it fails. Belonging to [master]: - #2008
1 parent 8f80b4e commit c536259

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Compiler/NFFrontEnd/NFTypeCheck.mo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ algorithm
375375
s2 := "' " + ty1_str + op_str + ty2_str + " '";
376376

377377
Error.addSourceMessage(Error.UNRESOLVABLE_TYPE, {s1, s2, msg_str}, Absyn.dummyInfo);
378+
fail();
378379
end try;
379380
end checkLogicalBinaryOperation;
380381

@@ -411,6 +412,7 @@ algorithm
411412
s1 := "' " + e1_str + op_str + " '";
412413

413414
Error.addSourceMessage(Error.UNRESOLVABLE_TYPE, {s1, msg_str}, Absyn.dummyInfo);
415+
fail();
414416
end try;
415417
end checkLogicalUnaryOperation;
416418

@@ -461,6 +463,7 @@ algorithm
461463
s2 := "' " + ty1_str + op_str + ty2_str + " '";
462464

463465
Error.addSourceMessage(Error.UNRESOLVABLE_TYPE, {s1, s2, msg_str}, Absyn.dummyInfo);
466+
fail();
464467
end try;
465468
end checkRelationOperation;
466469

@@ -2170,6 +2173,7 @@ algorithm
21702173
s1 := "' " + e1Str + Operator.symbol(inOp) + e2Str + " '";
21712174
s2 := "' " + t1Str + Operator.symbol(inOp) + t2Str + " '";
21722175
Error.addSourceMessage(Error.UNRESOLVABLE_TYPE, {s1,s2,suggestion}, Absyn.dummyInfo);
2176+
fail();
21732177
end binaryArrayOpError;
21742178

21752179
//public function getCrefType

0 commit comments

Comments
 (0)