summaryrefslogtreecommitdiffstats
path: root/source/slang/check.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/slang/check.cpp')
-rw-r--r--source/slang/check.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/source/slang/check.cpp b/source/slang/check.cpp
index e07bdf156..21e3b894b 100644
--- a/source/slang/check.cpp
+++ b/source/slang/check.cpp
@@ -7922,16 +7922,15 @@ namespace Slang
RefPtr<Expr> expr = inExpr;
for (;;)
{
- auto& type = expr->type;
- if (auto pointerLikeType = type->As<PointerLikeType>())
+ auto baseType = expr->type;
+ if (auto pointerLikeType = baseType->As<PointerLikeType>())
{
- type = QualType(pointerLikeType->elementType);
+ auto elementType = QualType(pointerLikeType->elementType);
+ elementType.IsLeftValue = baseType.IsLeftValue;
auto derefExpr = new DerefExpr();
derefExpr->base = expr;
- derefExpr->type = QualType(pointerLikeType->elementType);
-
- // TODO(tfoley): deal with l-value-ness here
+ derefExpr->type = elementType;
expr = derefExpr;
continue;