summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheyang <cheyang@bytedance.com>2020-12-14 19:55:28 +0800
committerMarge Bot <eric+marge@anholt.net>2020-12-17 04:48:27 +0000
commite6a66201a7ada69d93c9c9eb2112b20f87695754 (patch)
tree45d5af1088bcb019feaa97debf1a9d5cef1db926
parent193888fd7578fed0afd8e8f22a346dc127952da7 (diff)
symbol_table:fix mesa symbol table return scope error
According to the comment of this function,return a non-negative number for the number of scopes between the current scope and the scope where a symbol was defined. Signed-off-by: cheyang <cheyang@bytedance.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8084>
-rw-r--r--src/mesa/program/symbol_table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/symbol_table.c b/src/mesa/program/symbol_table.c
index f86588b76bd..2a544e03635 100644
--- a/src/mesa/program/symbol_table.c
+++ b/src/mesa/program/symbol_table.c
@@ -154,7 +154,7 @@ _mesa_symbol_table_symbol_scope(struct _mesa_symbol_table *table,
if (sym) {
assert(sym->depth <= table->depth);
- return sym->depth - table->depth;
+ return table->depth - sym->depth;
}
return -1;