From 159530072b7027152ed02aec79c3961957d0b417 Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Thu, 3 Nov 2022 12:30:25 +0100 Subject: [PATCH] Minor fix to getStackPos. Git commit hash is now auto filled in config.nim --- src/config.nim | 4 +--- src/frontend/compiler.nim | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/config.nim b/src/config.nim index 8446b0b..bbc53a7 100644 --- a/src/config.nim +++ b/src/config.nim @@ -34,9 +34,7 @@ when HeapGrowFactor <= 1: {.fatal: "Heap growth factor must be > 1".} const PeonVersion* = (major: 0, minor: 1, patch: 0) const PeonRelease* = "alpha" -const PeonCommitHash* = "c18f3837fe1c9b23fc306b77bf32d18493faa88f" -when len(PeonCommitHash) != 40: - {.fatal: "The git commit hash must be exactly 40 characters long".} +const PeonCommitHash* = staticExec("git rev-parse HEAD") const PeonBranch* = "master" when len(PeonBranch) > 255 or len(PeonBranch) == 0: {.fatal: "The git branch name's length must be within 1 and 255 characters".} diff --git a/src/frontend/compiler.nim b/src/frontend/compiler.nim index 3b92371..25ed39d 100644 --- a/src/frontend/compiler.nim +++ b/src/frontend/compiler.nim @@ -587,11 +587,11 @@ proc getStackPos(self: Compiler, name: Name): int = # we skip it and pretend it doesn't exist if variable.isPrivate or not variable.exported: continue - elif name.ident == variable.ident: + elif name == variable: # After all of these checks, we can - # finally check whether the name of - # the two variables match and if they - # do, bingo: We got our name object + # finally check whether the two names + # match (note: this also includes scope + # depth) found = true break inc(result)