mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
fix for script optimization of constants of type "opaque"
This commit is contained in:
parent
03347e235b
commit
5a3b519fb4
2 changed files with 14 additions and 3 deletions
11
src/Expr.h
11
src/Expr.h
|
@ -474,7 +474,16 @@ public:
|
|||
|
||||
// Optimization-related:
|
||||
ExprPtr Duplicate() override;
|
||||
ValPtr FoldVal() const override { return val; }
|
||||
|
||||
ValPtr FoldVal() const override {
|
||||
if ( type->Tag() == TYPE_OPAQUE )
|
||||
// Aggressive constant propagation can lead to the appearance of
|
||||
// opaque "constants". Don't consider these as foldable because
|
||||
// they're problematic to generate independently.
|
||||
return nullptr;
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
protected:
|
||||
void ExprDescribe(ODesc* d) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue