summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-check-expr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index 31b08e925..f70760c5d 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -2703,10 +2703,14 @@ void SemanticsVisitor::maybeDiagnoseConstVariableAssignment(Expr* expr)
{
e = subscriptExpr->baseExpression;
}
- else
+ else if (as<ThisExpr>(e))
{
break;
}
+ else
+ {
+ return;
+ }
}
// Check if we're trying to assign to a non-l-value (const variable, immutable member, etc.)
@@ -2979,7 +2983,9 @@ Expr* SemanticsVisitor::CheckInvokeExprWithCheckedOperands(InvokeExpr* expr)
else if (!as<ErrorType>(argExpr->type))
{
// Emit additional diagnostic for invalid pointer taking operations
- auto funcDeclRef = getDeclRef(m_astBuilder, funcDeclRefExpr);
+ auto funcDeclRef = funcDeclRefExpr
+ ? getDeclRef(m_astBuilder, funcDeclRefExpr)
+ : DeclRef<Decl>();
if (funcDeclRef)
{
auto knownBuiltinAttr =