* 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#11225; generic sandwich problems; [backport:1.2]
* progress
* delegating these symbols must be done via 'bind'
(cherry picked from commit 2f213db7ee)
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)
* 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)
* 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)
Since #8296, fgSetColor is no longer a global. These commands were
probably left out from the change as an oversight, so some tests have
been added to make sure this won't happen again.
(cherry picked from commit d1af9587b8)
* nimStackTraceOverride: enable stack traces in exceptions
This is a two-step stack trace collection scheme, because re-raised
exceptions will collect multiple stack traces but use them rarely, when
printing info about an uncaught exception, so it makes sense to only do
the cheap stack unwinding all the time and the relatively expensive
debugging information collection on-demand.
`asyncfutures` implements its own `$` proc for printing
`seq[StackTraceEntry]`, so we have to add the debugging info there, just
like we do for the private `$` proc in `system/excpt`.
* cleaned up PR #15284
Co-authored-by: Ștefan Talpalaru <stefantalpalaru@yahoo.com>
(cherry picked from commit 1fae66e4df)