Mesa (master): symbol_table:fix mesa symbol table return scope error

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 17 05:05:13 UTC 2020


Module: Mesa
Branch: master
Commit: e6a66201a7ada69d93c9c9eb2112b20f87695754
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6a66201a7ada69d93c9c9eb2112b20f87695754

Author: cheyang <cheyang at bytedance.com>
Date:   Mon Dec 14 19:55:28 2020 +0800

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 at bytedance.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8084>

---

 src/mesa/program/symbol_table.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;



More information about the mesa-commit mailing list