diff options
author | Eric Anholt <eric@anholt.net> | 2010-03-26 15:51:45 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2010-03-26 17:51:41 -0700 |
commit | c4f86d3b80047ce3a8be1fa69396856af1719bc9 (patch) | |
tree | 8382f1ba0f5cd84fc6e1209dce9204debd07d373 /ir.h | |
parent | 3c36b2df7c854d23b2be9580e416fb04079a1bef (diff) |
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.
Diffstat (limited to 'ir.h')
-rw-r--r-- | ir.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 { |