mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38:20 +00:00
Merge remote-tracking branch 'origin/topic/jsiwek/gh-286'
Added note about different behaviour to NEWS. Closes #286. * origin/topic/jsiwek/gh-286: GH-286: Check for record type mismatch in ternary operator
This commit is contained in:
commit
e2172018ee
5 changed files with 41 additions and 12 deletions
|
@ -2337,7 +2337,13 @@ CondExpr::CondExpr(Expr* arg_op1, Expr* arg_op2, Expr* arg_op3)
|
|||
ExprError("operands must be of the same type");
|
||||
|
||||
else
|
||||
SetType(op2->Type()->Ref());
|
||||
{
|
||||
if ( IsRecord(bt2) && IsRecord(bt3) &&
|
||||
! same_type(op2->Type(), op3->Type()) )
|
||||
ExprError("operands must be of the same type");
|
||||
else
|
||||
SetType(op2->Type()->Ref());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue