summaryrefslogtreecommitdiff
path: root/symbol_table.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-24 14:56:36 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-24 14:56:36 -0700
commit44bb1a62f9fa55a2f4febc87abcfb78386283c0e (patch)
treeb2f3c7cedc71328be6d6736207ffe5a3e3dd08bd /symbol_table.c
parentd00b7958c033a114d1d4005a7ed59653ca80d1ce (diff)
Allow duplicate symbols at the same scope that are in different name spaces
Diffstat (limited to 'symbol_table.c')
-rw-r--r--symbol_table.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/symbol_table.c b/symbol_table.c
index 5d748f45c7..0f0df7a261 100644
--- a/symbol_table.c
+++ b/symbol_table.c
@@ -347,10 +347,16 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table,
check_symbol_table(table);
- /* If the symbol already exists at this scope, it cannot be added to the
- * table.
+ /* If the symbol already exists in this namespace at this scope, it cannot
+ * be added to the table.
*/
- if (hdr->symbols && (hdr->symbols->depth == table->depth))
+ for (sym = hdr->symbols
+ ; (sym != NULL) && (sym->name_space != name_space)
+ ; sym = sym->next_with_same_name) {
+ /* empty */
+ }
+
+ if (sym && (sym->depth == table->depth))
return -1;
sym = calloc(1, sizeof(*sym));