From f30d9ceaa95fd3f48cef386935ecc59226fdbbc1 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Wed, 24 Jan 2024 12:25:53 -0800 Subject: [PATCH] name match against later-added global variable symbols, since apparently PDBs can be produced to keep stale global symbols around to --- src/eval/eval_parser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/eval/eval_parser.c b/src/eval/eval_parser.c index e218d2c6..febb38bb 100644 --- a/src/eval/eval_parser.c +++ b/src/eval/eval_parser.c @@ -937,7 +937,11 @@ eval_parse_expr_from_text_tokens__prec(Arena *arena, EVAL_ParseCtx *ctx, String8 } if(matches_count != 0) { - U32 match_idx = matches[0]; + // NOTE(rjf): apparently, PDBs can be produced such that they + // also keep stale *GLOBAL VARIABLE SYMBOLS* around too. I + // don't know of a magic hash table fixup path in PDBs, so + // in this case, I'm going to prefer the latest-added global. + U32 match_idx = matches[matches_count-1]; RADDBG_GlobalVariable *global_var = &ctx->rdbg->global_variables[match_idx]; EVAL_OpList oplist = {0}; eval_oplist_push_op(arena, &oplist, RADDBG_EvalOp_ModuleOff, global_var->voff);