Commit Graph

6244 Commits

Author SHA1 Message Date
Tanguy
f2bbff989f Fix nested finally handling in closureiters [backport] (#19933)
* Fix nested finally handling in closureiters

* Fix CI

* review comment

* third time the charm

* Update compiler/closureiters.nim

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>

Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
(cherry picked from commit fb5fbf1e08)
2022-07-18 17:16:06 +02:00
flywind
7b35ce9812 fix NimNode comment repr() regression [backport: 1.2] (#19726)
(cherry picked from commit 15ae9323e8)
2022-06-20 08:49:34 +02:00
flywind
0798bd020b setjump => setjmp [backport: 1.2] (#19496)
(cherry picked from commit d0287748fe)
2022-06-20 08:48:57 +02:00
flywind
5e102df04d nrvo shouldn't touch bycopy object[backport:1.2] (#19385)
fix nim-lang#19342

(cherry picked from commit 9b9ae8a487)
2022-01-17 07:40:54 +01:00
Ștefan Talpalaru
8ea5475dd9 nimRawSetjmp: support Windows (#19197)
* nimRawSetjmp: support Windows

Using `_setjmp()` directly is required to avoid some rare (but very
annoying) exception-related stack corruption leading to segfaults on
Windows, with Mingw-w64 and SEH.
More details: https://github.com/status-im/nimbus-eth2/issues/3121

Also add "nimBuiltinSetjmp" - mostly for benchmarking.

* fix for Apple's Clang++

(cherry picked from commit 69aabdab80)
2021-12-11 05:48:35 +01:00
Andreas Rumpf
3e6d708175 implements https://github.com/nim-lang/RFCs/issues/260 (#15505)
* implements https://github.com/nim-lang/RFCs/issues/260

* added a test case

(cherry picked from commit 51e3e0c7c4)
2021-12-10 14:59:44 +01:00
Tanguy
6e4fdbc4a9 fix #19193 (#19195) [backport:1.2]
(cherry picked from commit cd592ed85b)
2021-12-07 21:51:46 +01:00
Etan Kissling
4cb522fb8a allow HSlice bounded by constants of distinct types (#19219) [backport:1.2]
When creating heterogenous slices of distinct types, the compiler does
not initialize the internal type's `size` before accessing it.
This then leads to this crash message:
```
compiler/int128.nim(594, 11) `false` masking only implemented for 1, 2, 4 and 8 bytes [AssertionError]
```
This patch initializes the `size` properly, fixing the problem.

(cherry picked from commit 0213c7313b)
2021-12-07 21:48:08 +01:00
Andreas Rumpf
a34845b66c fixes #11225; generic sandwich problems; [backport:1.2] (#17255)
* fixes #11225; generic sandwich problems; [backport:1.2]
* progress
* delegating these symbols must be done via 'bind'

(cherry picked from commit 2f213db7ee)
2021-12-07 16:34:58 +01:00
Andreas Rumpf
79f95a2efc misc bugfixes [backport:1.2] (#19203)
(cherry picked from commit 23c117a950)
2021-12-06 12:53:37 +01:00
Andreas Rumpf
8a3f542532 fixes #14470 [backport:1.2] (#19115)
(cherry picked from commit 15157d06c3)
2021-12-06 12:51:56 +01:00
Andreas Rumpf
2009df72cb fixes a 'mixin' statement handling regression [backport:1.2] (#18968)
(cherry picked from commit 8eef557157)
2021-12-06 12:51:32 +01:00
Etan Kissling
735e3eea78 allow converting static vars to openArray (#19049)
When assigning constant output to a seq, and then passing that static
seq to other functions that take `openArray`, the compiler may end up
producing errors, as it does not know how to convert `static[seq[T]]`
to `openArray[T]`. By ignoring the `static` wrapper on the type for
the purpose of determining data memory location and length, this gets
resolved cleanly. Unfortunately, it is relatively tricky to come up
with a minimal example, as there are followup problems from the failing
conversion, e.g., this may lead to `internal error: inconsistent
environment type`, instead of the relevant `openArrayLoc` error message.

(cherry picked from commit 490c4226a5)
2021-10-27 11:04:39 +02:00
Andreas Rumpf
1802f94868 fixes #18643 [backport:1.0] (#18678)
(cherry picked from commit 018465a234)
2021-08-24 07:18:08 +02:00
Andreas Rumpf
74f34c81e8 feature: the compiler can warn when you use the implicit 'result' variable (#17988) [backport:1.2]
* implements #17855

(cherry picked from commit 378ee7f888)
2021-05-17 19:04:34 +02:00
Andreas Rumpf
34563f86c2 fixes #15848 [backport:1.2] (#17959)
(cherry picked from commit 51f3ef6cb8)
2021-05-17 16:13:10 +02:00
Andreas Rumpf
ba02bf50b9 CIs: attempt to use csources_v1 (#16282)
* CIs: attempt to use csources_v1
* also updated the BSDs
* also updated azure pipelines
* std modules should not itself use the 'std/' import dir...
* compiler has to be careful with std/ for v1 booting

(cherry picked from commit a9b62de895)
2021-04-28 08:50:39 +02:00
narimiran
6238f2ee1e Revert "fixes #11225; generic sandwich problems; [backport:1.2] (#17255)"
This reverts commit d85b7dde7b.
2021-04-13 09:59:53 +02:00
narimiran
5ea5d82507 Revert "fixes #15210 [backport:1.2] (#15237)"
This reverts commit ae688aa7f5.
2021-03-22 11:52:22 +01:00
Andreas Rumpf
d85b7dde7b fixes #11225; generic sandwich problems; [backport:1.2] (#17255)
* fixes #11225; generic sandwich problems; [backport:1.2]
* progress
* delegating these symbols must be done via 'bind'

(cherry picked from commit 2f213db7ee)
2021-03-20 08:44:04 +01:00
alaviss
86c8977726 compiler/installer.ini: package cacert.pem on Windows [backport:1.2] (#17172)
Follow up of 5dc544e1f5

After updating windeps.zip, it appears that Windows' build was
unchanged. As it turns out, cacert.pem is not set for packaging by the
compiler package manifest.

This commit add cacert.pem to the Windows package.

(cherry picked from commit d35f366d6f)
2021-03-18 17:25:41 +01:00
narimiran
ebc114c526 Revert "fix #17118 (#17119) [backport:1.2]"
This reverts commit 2e896e3360.
2021-02-22 13:51:01 +01:00
flywind
2e896e3360 fix #17118 (#17119) [backport:1.2]
* fix js unsigned integer
* Use `std` prefix for standard library modules
* fix #17118

(cherry picked from commit 32bf10126c)
2021-02-22 10:31:14 +01:00
Andreas Rumpf
ca1f97951c fixes #17085 [backport:1.2] (#17101)
(cherry picked from commit 4395a26764)
2021-02-19 20:36:13 +01:00
narimiran
c18726f4a1 correctly backport pragmas changes 2021-02-09 20:23:13 +01:00
hlaaftana
aa98aee18d Remove declPragmas from lambdas [backport:1.0] (#16966)
* Remove declPragmas from lambdas [backport:1.0]

* add test for exportc

* fix test

* fix align, nodecl -> noinit

(cherry picked from commit 49b64e8dc7)
2021-02-09 15:44:29 +01:00
Andreas Rumpf
90cf7177ca fixes #16897 [backport:1.2] (#16900)
(cherry picked from commit 91ace2188a)
2021-02-02 14:35:54 +01:00
Timothee Cour
040adf415b [backport 1.0] add backend support for js bigint (#16606)
* add backend support for js bigint

* cleanup

* add tests

* add -d:nimHasJsBigIntBackend

* cleanup

* more tests

(cherry picked from commit 025ca660f7)
2021-02-01 15:24:46 +01:00
Timothee Cour
bdb3cc3a8a [backport => 1.0] fix #16428 vmops now works for generic procs (#16429)
* fix #16428 vmops now works for generic procs

* remove duplication

(cherry picked from commit bc84d9c8cb)
2021-02-01 15:23:58 +01:00
Andreas Rumpf
2b9c458692 OSX: support for M1 [backport:1.0] (#16279)
(cherry picked from commit 94bb816de3)
2020-12-19 14:21:50 +01:00
Andreas Rumpf
0888ac4097 fixes #16069; [backport:1.2] [backport:1.4] (#16115)
* fixes #16069; refs https://github.com/nim-lang/RFCs/issues/257 [backport:1.2] [backport:1.4]

* make tests green again

(cherry picked from commit d306a04466)
2020-11-26 08:09:49 +01:00
Andreas Rumpf
8c3f500338 fixes #15942 [backport:1.2] [backport:1.4] (#16051)
(cherry picked from commit 1efd11e266)
2020-11-25 12:58:49 +01:00
Bung
a832fa65c4 Fix #8404 JS backend doesn't handle float->int type conversion (#15950) [backport]
* Fix #8404 JS backend doesn't handle float->int type conversion
* handle conv to uint as cast, discard other cases
* limit to int32, times use int64
* toInt including tyInt64 break times timezones lib, ignore for now
* also affect to vm
* move to tests/misc/t8404.nim

(cherry picked from commit 797cb2e67b)
2020-11-25 12:52:23 +01:00
Jason Beetham
fabbb7ea3e Fixed iteration limit hit from execproc (#15723) [backport:1.2] [backport:1.4]
When calling procs from Nim in Nimscript you could hit the VM iteration limit even though the code is functioning properly. This resolves that by making the iteration limit reset eachtime you call a proc.

(cherry picked from commit a87617956f)
2020-10-26 11:14:55 +01:00
Timothee Cour
d777a8f86c fix #15704 #15597 wrong VM register was freed (#15705)
(cherry picked from commit d4c2e2c53f)
2020-10-26 10:29:54 +01:00
Clyybber
00cd7b8ca4 Revert "fixes #15280 [backport:1.2] (#15281)" (#15700)
This reverts commit 3f00a738db.

(cherry picked from commit d4022ebe53)
2020-10-24 17:18:44 +02:00
Andreas Rumpf
59b5bdc2c6 renamed '=' to '=copy' [backport:1.2] (#15585)
(cherry picked from commit da4aa2e1fb)
2020-10-15 13:32:25 +02:00
Andreas Rumpf
2ce9352285 sigmatch: hotfix [backport] (#15565)
(cherry picked from commit c664fb2843)
2020-10-14 11:00:47 +02:00
Araq
991902e286 fixes a renderer regression
(cherry picked from commit 0ac74ddd74)
2020-10-09 12:06:05 +02:00
narimiran
5534c56d05 manually backport #15506 2020-10-09 12:03:07 +02:00
cooldome
777c28cf45 fix #15516 (#15518)
(cherry picked from commit fe187719ab)
2020-10-09 10:04:24 +02:00
alaviss
60783ccc11 koch, compiler: bundle fusion as part of the source archive (#15409)
This allows distributions to build Nim from the downloaded source
archive without an Internet connection.

(cherry picked from commit d4892e9388)
2020-10-07 19:44:00 +02:00
Andreas Rumpf
9599d95caa fixes https://github.com/nim-lang/RFCs/issues/257 [backport:1.2] (#15479)
(cherry picked from commit 2288188fe9)
2020-10-06 09:50:36 +02:00
Andreas Rumpf
e3c85f5885 remove nim.cfg file change lefover [backport:1.2] (#15469)
(cherry picked from commit ff70ff529d)
2020-10-06 08:49:06 +02:00
Andreas Rumpf
da03b5ca8b closureiters: fixes #15243 (#15454) [backport:1.2]
* fixes #15243 [backport:1.2]

(cherry picked from commit aa1d7fe1e9)
2020-10-06 08:48:44 +02:00
Andreas Rumpf
c53c6458b0 finish the stacktraces.nim implementation [backport:1.2] (#15393)
(cherry picked from commit e2d80b15a6)
2020-10-06 08:46:25 +02:00
Andreas Rumpf
7ef706fef9 fixes #15360 [backport:1.2] (#15378)
(cherry picked from commit c2434d939e)
2020-09-21 18:19:13 +02:00
Andreas Rumpf
7bba0deb1d fixes #15280 [backport:1.2] (#15281)
* fixes #15280 [backport:1.2]

* make tests green again

* adapt tests

(cherry picked from commit 3f00a738db)
2020-09-11 13:58:04 +02:00
PMunch
53f3bd9376 Fix sets for architectures with default integers smaller than 32 bits (#15258) [backport]
(cherry picked from commit 244760197c)
2020-09-11 13:58:04 +02:00
Andreas Rumpf
ae688aa7f5 fixes #15210 [backport:1.2] (#15237)
* fixes #15210 [backport:1.2]

* use patched version of bigints library

(cherry picked from commit ff13f8cc3c)
2020-09-11 13:58:04 +02:00