diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim index 46a9177ad9..ff8f768bd3 100644 --- a/compiler/ccgutils.nim +++ b/compiler/ccgutils.nim @@ -181,7 +181,7 @@ proc mangle*(name: string): string = of '_': # we generate names like 'foo_9' for scope disambiguations and so # disallow this here: - if i < name.len-1 and name[i+1] in Digits: + if i > 0 and i < name.len-1 and name[i+1] in Digits: discard else: add(result, c)