* switch from PRNG to random module
* fix the regression
* comments + tests
* runnableExamples
* make oids better
(cherry picked from commit 89a21e4ec7)
* 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)
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)
* fixes#14511 [backport:1.4]
Signed-off-by: Dankr4d <dude569@freenet.de>
* Replaced fix with code from alaviss, for better readability, with small
changes.
Signed-off-by: Dankr4d <dude569@freenet.de>
* - Specified output in test.
Signed-off-by: Dankr4d <dude569@freenet.de>
* Replaced case in nnkRecCase with a simpler version, which just adds the
last son.
Signed-off-by: Dankr4d <dude569@freenet.de>
* Update tests/macros/t14511.nim
* Update tests/macros/t14511.nim
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
(cherry picked from commit c70e4040bd)
Copying StackTraceEntry instances when nimStackTraceOverride is defined
breaks the link between a cstring field that's supposed to point at
another string field in the same object.
Sometimes, the original object is garbage collected, that memory region
reused for storing other strings, so when the StackTraceEntry copy tries
to use its cstring pointer to construct a traceback message, it accesses
unrelated strings.
This only happens for async tracebacks and this patch prevents that by
making sure we only use the string fields when nimStackTraceOverride is
defined.
Async tracebacks also beautified slightly by getting rid of an extra line
that was supposed to be commented out, along with the corresponding debugging output.
There's also a micro-optimisation to avoid concatenating two strings just
to get their combined length.
(cherry picked from commit a1c82c39af)
* fixes#11225; generic sandwich problems; [backport:1.2]
* progress
* delegating these symbols must be done via 'bind'
(cherry picked from commit 2f213db7ee)
* fixes#17033 [backport:1.4]
* make test robust against stdlib gensym things
* cleanup assertions.nim to make topt_no_cursor easier to get right
(cherry picked from commit f32ffb6ed8)
* Remove declPragmas from lambdas [backport:1.0]
* add test for exportc
* fix test
* fix align, nodecl -> noinit
(cherry picked from commit 49b64e8dc7)
* basic cleanups regarding SSL handling
* enabled certificate checking on Windows
* updated the SSL test
* quoting helps
(cherry picked from commit abac35e743)