diff options
| author | Yong He <yonghe@outlook.com> | 2022-08-12 07:57:41 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-12 07:57:41 -0700 |
| commit | 786f48d32340c36a06865a333ff9066033b5b2bc (patch) | |
| tree | a3f5823e66b59517c6cd4a7d5ddd1774bf10ccb3 /source/slang/slang-lower-to-ir.cpp | |
| parent | b5d84f60d36b81c7e8263048dda031a9be14a106 (diff) | |
Fix logic of `is` operator. (#2359)
Diffstat (limited to 'source/slang/slang-lower-to-ir.cpp')
| -rw-r--r-- | source/slang/slang-lower-to-ir.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/slang/slang-lower-to-ir.cpp b/source/slang/slang-lower-to-ir.cpp index c7fbfda77..81ea93f77 100644 --- a/source/slang/slang-lower-to-ir.cpp +++ b/source/slang/slang-lower-to-ir.cpp @@ -3966,9 +3966,9 @@ struct ExprLoweringVisitorBase : ExprVisitor<Derived, LoweredValInfo> LoweredValInfo visitIsTypeExpr(IsTypeExpr* expr) { - if (expr->isAlwaysTrue) + if (expr->constantVal) { - return LoweredValInfo::simple(getBuilder()->getBoolValue(true)); + return LoweredValInfo::simple(getBuilder()->getBoolValue(expr->constantVal->value)); } auto value = lowerLValueExpr(context, expr->value); auto type = lowerType(context, expr->type); |
