mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 04:28:20 +00:00
GH-286: Check for record type mismatch in ternary operator
Fixes GH-286
This commit is contained in:
parent
a342090f18
commit
74c225c7cb
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