From c4f86d3b80047ce3a8be1fa69396856af1719bc9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 26 Mar 2010 15:51:45 -0700 Subject: [PATCH] Make read-only variables not be considered lvalues. This should fix tests trying to assign to builtin "in" variables, and will also be relied on for post_inc/dec handling. --- ir.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ir.h b/ir.h index a69f932c5a8..7e2f304b41d 100644 --- a/ir.h +++ b/ir.h @@ -455,7 +455,17 @@ public: bool is_lvalue() { - return var != NULL; + ir_variable *as_var; + + if (var == NULL) + return NULL; + + as_var = var->as_variable(); + + if (as_var == NULL) + return NULL; + + return !as_var->read_only; } enum { -- 2.30.2