Commit Graph

21 Commits

Author SHA1 Message Date
ringabout
919d0d5ea8 fixes #25369 (#25370)
fixes #25369

(cherry picked from commit 548b1c6ef8)
2025-12-18 20:53:04 +01:00
ringabout
2ddda806a9 fixes #25284; .global initialization inside method hoisted to preInitProc (#25285)
fixes #25284

```nim
proc m2()  =
  let v {.global, used.}: string = f2(f2("123"))
```

transform lifted `.global`statements in the top level scope

(cherry picked from commit 9becd1453d)
2025-11-15 12:27:12 +01:00
bptato
d84ca9c013 Allow assignment of nested non-closure procs to globals (#25154)
For memory-safety, this only seems problematic in case of closures, so I
just special cased that.

Fixes #25131

(cherry picked from commit d73f478bdc)
2025-09-12 14:42:24 +02:00
Miran
911a651984 Backport #25016 (#25053)
This is a `version-2-2` variant of the existing fix.

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
2025-07-15 11:06:18 +02:00
ringabout
88f1d4f154 Revert "fixes #24997; {.global.} variable in recursive function (#250… (#25019)
…16)"

This reverts commit 1a2ee566e3.
2025-06-27 23:17:47 +08:00
ringabout
1a2ee566e3 fixes #24997; {.global.} variable in recursive function (#25016)
fixes #24997

handles functions in recursive order

(cherry picked from commit 3ce38f2959)
2025-06-27 13:43:56 +02:00
ringabout
11fc6962ae fixes #24981; the length of the seq changed of procGloals (#24984)
fxies #24981

`m.g.graph.procGlobals` could change because the right side of `.global`
assignment (e.g. `let a {.global.} = g(T)`) may trigger injections for
unhandled procs

(cherry picked from commit ffb993d5bd)
2025-06-10 06:31:46 +02:00
ringabout
975ca268f0 fixes #24940; fixes #17552; lifts {.global.} in injectDestructorCalls (#24962)
fixes #24940
fixes #17552

Collects `{.global.}` (i.e. if it was changed into a hook call: `=copy`,
`=sink`) in `injectDestructorCalls` and generates it in the init
sections in cgen

(cherry picked from commit 3c0446b082)
2025-05-26 10:13:29 +02:00
Bung
95c751a9e4 fix #15005; [ARC] Global variable declared in a block is destroyed too… (#22388)
* fix #15005 [ARC] Global variable declared in a block is destroyed too early
2023-08-06 15:46:43 +08:00
ringabout
64accd1c57 fixes {.global.} ref typedesc regressions (#22046) 2023-06-08 13:06:47 +02:00
metagn
b97d603cd0 some test cleanups & category reorganization (#22010)
* clean up some test categories

* mention exact slice issue

* magics into system

* move trangechecks into overflow

* move tmemory to system

* try fix CI

* try fix CI

* final CI fix
2023-06-06 06:54:07 +02:00
Bung
266cc69f19 fix #21896 asign parameter to global variable generates invalid code (#21900) 2023-05-24 15:30:14 +02:00
Bung
354eb2a86c fix #20866 [ORC] Bad codegen for global pointer to iterator (#20876) 2022-11-22 20:05:16 +01:00
Bung
1410243d3b fix #3505 wrong var {.global.} initialization, asign variable to it (#20812)
* fix #3505 wrong var {.global.} initialization, asign variable to it

* fix #5132 as well

* follow suggestions

* handle all call kinds

* Update tests/global/t3505.nim

* Update compiler/semstmts.nim

* Update compiler/semstmts.nim

* Update compiler/semstmts.nim

* follow suggestion

* Update compiler/semstmts.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-11-12 22:57:07 +01:00
Arne Döring
1105d03644 require errormsg to be specified before file. 2018-12-11 21:23:21 +01:00
Arne Döring
031bfdec6f make run the default action of a test in tester 2018-11-23 11:58:28 +01:00
LemonBoy
9543689306 Make static blocks introduce their own scope
Treat the static block as a normal block, don't leak any identifier in
the outer scope.

Fixes #5958
2018-06-24 18:27:40 +02:00
Adam Strzelecki
e80465dacf tests: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:04:32 +02:00
Araq
24ae0c387f some love for the testsuite; fixed regressions 2015-03-01 21:41:21 +01:00
Zahary Karadjov
cda92048ba fix some trivial errors in the test suite and some more regressions caused by tyTypeDesc[tyNone] 2014-02-18 02:46:14 +02:00
Araq
20b5f31c03 new tester; all tests categorized 2014-01-13 02:10:03 +01:00