mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
always mangle local variables (#24681)
ref #24677
(cherry picked from commit 1af88a2d20)
This commit is contained in:
@@ -115,7 +115,7 @@ proc fillLocalName(p: BProc; s: PSym) =
|
||||
if s.kind == skTemp:
|
||||
# speed up conflict search for temps (these are quite common):
|
||||
if counter != 0: result.add "_" & rope(counter+1)
|
||||
elif counter != 0 or isKeyword(s.name) or p.module.g.config.cppDefines.contains(key):
|
||||
elif s.kind != skResult:
|
||||
result.add "_" & rope(counter+1)
|
||||
p.sigConflicts.inc(key)
|
||||
s.loc.snippet = result
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
discard """
|
||||
matrix: "--mm:refc"
|
||||
output: "Hello"
|
||||
ccodecheck: "\\i@'a = ((NimStringDesc*) NIM_NIL)'"
|
||||
ccodecheck: "\\i@'a_1 = ((NimStringDesc*) NIM_NIL)'"
|
||||
"""
|
||||
|
||||
proc main() =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
discard """
|
||||
output: "1"
|
||||
cmd: r"nim c --hints:on $options --mm:refc -d:release $file"
|
||||
ccodecheck: "'NI volatile state;'"
|
||||
ccodecheck: "'NI volatile state_1;'"
|
||||
targets: "c"
|
||||
"""
|
||||
|
||||
|
||||
@@ -45,3 +45,14 @@ block: # bug #22354
|
||||
|
||||
|
||||
main()
|
||||
|
||||
proc main = # bug #24677
|
||||
let NULL = 1
|
||||
doAssert NULL == 1
|
||||
|
||||
var COMMA = 1
|
||||
doAssert COMMA == 1
|
||||
|
||||
for NDEBUG in 0..2:
|
||||
doAssert NDEBUG == NDEBUG
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user