mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
introduce internal "mask" expression node to avoid mixed-type overloading of "/"
This commit is contained in:
parent
b53a025b1e
commit
434a7e059d
6 changed files with 55 additions and 13 deletions
|
@ -80,6 +80,7 @@ string CPPCompile::GenExpr(const Expr* e, GenType gt, bool top_level)
|
|||
case EXPR_TIMES:
|
||||
return GenBinary(e, gt, "*", "mul");
|
||||
case EXPR_DIVIDE:
|
||||
case EXPR_MASK: // later code will split into addr masking
|
||||
return GenBinary(e, gt, "/", "div");
|
||||
case EXPR_MOD:
|
||||
return GenBinary(e, gt, "%", "mod");
|
||||
|
@ -1060,7 +1061,7 @@ string CPPCompile::GenBinaryAddr(const Expr* e, GenType gt, const char* op)
|
|||
{
|
||||
auto v1 = GenExpr(e->GetOp1(), GEN_DONT_CARE) + "->AsAddr()";
|
||||
|
||||
if ( e->Tag() == EXPR_DIVIDE )
|
||||
if ( e->Tag() == EXPR_MASK )
|
||||
{
|
||||
auto gen = string("addr_mask__CPP(") + v1 + ", " + GenExpr(e->GetOp2(), GEN_NATIVE) + ")";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue