Minor fix to getStackPos. Git commit hash is now auto filled in config.nim

This commit is contained in:
Mattia Giambirtone 2022-11-03 12:30:25 +01:00
parent 28798789dd
commit 159530072b
2 changed files with 5 additions and 7 deletions

View File

@ -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".}

View File

@ -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)