Browse Source

Improve error message for addressing a swizzle intermediate array value

gingerBill 4 years ago
parent
commit
104aea9f42
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/check_expr.cpp

+ 4 - 0
src/check_expr.cpp

@@ -1805,6 +1805,10 @@ void check_unary_expr(CheckerContext *c, Operand *o, Token op, Ast *node) {
 					case Addressing_Constant:
 					case Addressing_Constant:
 						error(op, "Cannot take the pointer address of '%s' which is a constant", str);
 						error(op, "Cannot take the pointer address of '%s' which is a constant", str);
 						break;
 						break;
+					case Addressing_SwizzleValue:
+					case Addressing_SwizzleVariable:
+						error(op, "Cannot take the pointer address of '%s' which is a swizzle intermediate array value", str);
+						break;
 					default:
 					default:
 						error(op, "Cannot take the pointer address of '%s'", str);
 						error(op, "Cannot take the pointer address of '%s'", str);
 						break;
 						break;