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".} {.fatal: "Heap growth factor must be > 1".}
const PeonVersion* = (major: 0, minor: 1, patch: 0) const PeonVersion* = (major: 0, minor: 1, patch: 0)
const PeonRelease* = "alpha" const PeonRelease* = "alpha"
const PeonCommitHash* = "c18f3837fe1c9b23fc306b77bf32d18493faa88f" const PeonCommitHash* = staticExec("git rev-parse HEAD")
when len(PeonCommitHash) != 40:
{.fatal: "The git commit hash must be exactly 40 characters long".}
const PeonBranch* = "master" const PeonBranch* = "master"
when len(PeonBranch) > 255 or len(PeonBranch) == 0: when len(PeonBranch) > 255 or len(PeonBranch) == 0:
{.fatal: "The git branch name's length must be within 1 and 255 characters".} {.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 # we skip it and pretend it doesn't exist
if variable.isPrivate or not variable.exported: if variable.isPrivate or not variable.exported:
continue continue
elif name.ident == variable.ident: elif name == variable:
# After all of these checks, we can # After all of these checks, we can
# finally check whether the name of # finally check whether the two names
# the two variables match and if they # match (note: this also includes scope
# do, bingo: We got our name object # depth)
found = true found = true
break break
inc(result) inc(result)