From 8e5c2c65348e46e9f40bd6b2e0ce5119239fffde Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 17 Jan 2022 14:43:43 +0900 Subject: [PATCH] [gamecode] Correct type of return address in stack This is another one of those "why signed?" things: can't have negative return addresses. --- include/QF/progs.h | 2 +- libs/gamecode/pr_debug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/QF/progs.h b/include/QF/progs.h index e8b4136dc..55ac37b69 100644 --- a/include/QF/progs.h +++ b/include/QF/progs.h @@ -1801,7 +1801,7 @@ extern const char *pr_gametype; typedef struct strref_s strref_t; typedef struct { - pr_int_t staddr; ///< Return statement. + pr_uint_t staddr; ///< Return statement. bfunction_t *func; ///< Calling function. strref_t *tstr; ///< Linked list of temporary strings. } prstack_t; diff --git a/libs/gamecode/pr_debug.c b/libs/gamecode/pr_debug.c index 1034c7b95..e4268eef5 100644 --- a/libs/gamecode/pr_debug.c +++ b/libs/gamecode/pr_debug.c @@ -1721,7 +1721,7 @@ dump_frame (progs_t *pr, prstack_t *frame) pr_lineno_t *lineno = PR_Find_Lineno (pr, frame->staddr); pr_auxfunction_t *func = PR_Get_Lineno_Func (pr, lineno); pr_uint_t line = PR_Get_Lineno_Line (pr, lineno); - pr_int_t addr = PR_Get_Lineno_Addr (pr, lineno); + pr_uint_t addr = PR_Get_Lineno_Addr (pr, lineno); line += func->source_line; if (addr == frame->staddr) {