Commit Graph

7705 Commits

Author SHA1 Message Date
Mamy Ratsimbazafy
ed966b77c3 The whole options module should be inline (#14417) [backport:1.2]
* The whole options module should be inline

* Use inline per proc and tag `lent` where appropriate

* Remove lent annotation (failing at compiletime)

(cherry picked from commit f71f8b0239)
2020-06-01 12:11:15 +02:00
Andreas Rumpf
7800fa394f specialize genericReset (#14398)
* progress
* make tests green
* maybe we also want to reset pointers, dunno
* progress
* cleanup; fixes #13879 [backport:1.2]

(cherry picked from commit b35d370d88)
2020-05-20 15:30:20 +02:00
Kaushal Modi
7826356f36 Fail quickly if re or nre module is attempted to be compiled with js [backport] (#14341)
Fixes https://github.com/nim-lang/Nim/issues/14338 .

(cherry picked from commit a2a3fa1039)
2020-05-14 07:32:38 +02:00
slangmgh
de867bea3c Fix #14289 (#14304) [backport]
(cherry picked from commit 76f7e95814)
2020-05-14 07:31:03 +02:00
Timothee Cour
01f42a5933 fix a critical bug in windows.osproc leading to resource leaks and blocking IO [backport] (#14296)
(cherry picked from commit d11cb9d495)
2020-05-13 08:15:24 +02:00
alaviss
8e5c389bef net: remove more erroneous set constructions (#14252) [backport]
Refs #13764

(cherry picked from commit 1a1e9986a3)
2020-05-13 08:15:17 +02:00
Andreas Rumpf
75abd4dc68 fixes #14209 [backport:1.2] (#14213)
* fixes #14209 [backport:1.2]
* improve stability

(cherry picked from commit 64e839d5fd)
2020-05-06 17:22:16 +02:00
slangmgh
05151d7f62 Fix #14151 (#14205) [backport]
(cherry picked from commit d5c014e59b)
2020-05-06 17:13:52 +02:00
Kaushal Modi
9ff2ec7ec5 Document that proc named fooTask is created for every foo task [backport] (#14187)
Ref: https://irclogs.nim-lang.org/01-05-2020.html#15:18:03
(cherry picked from commit 0880f118d3)
2020-05-06 17:09:59 +02:00
Andreas Rumpf
62b9dcb8db fixes #13698 [backport:1.2] (#14175)
(cherry picked from commit 89be5be03e)
2020-05-06 17:09:21 +02:00
Andreas Rumpf
ff90206332 fixes #14054 [backport:1.2] (#14061)
* fixes #14054

* make tests green again

* more tests are green

* maybe now

(cherry picked from commit cc60caedb3)
2020-05-06 17:09:07 +02:00
Andreas Rumpf
49decbf4b4 fixes #14079 [backport:1.2] (#14163)
(cherry picked from commit d9e907c0e2)
2020-05-06 17:08:32 +02:00
hlaaftana
14ce3e45e0 small docs fix in typetraits (#14108)
(cherry picked from commit 31ba27590c)
2020-04-26 07:25:07 +02:00
Jae Yang
4513cb0680 Fixes #14110 (#14111)
Fixes jsffi usage example in doc

(cherry picked from commit 362c8964bf)
2020-04-26 07:25:01 +02:00
alaviss
57f41d6b6c asyncdispatch: export Callback (#14042) [backport]
This let us see the definition of `Callback` in docs, which is required
to even make use of asyncdispatch.

Ref #13539.

(cherry picked from commit 7beed44fc9)
2020-04-23 18:44:24 +02:00
Timothee Cour
dbf35e2ac3 fix https://github.com/nim-lang/RFCs/issues/211: var a: DateTime compiles and is usable (#14002) [backport:1.2]
* fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` works
* assertValidDate checks for sentinel month

(cherry picked from commit e3919b658f)
2020-04-23 18:44:03 +02:00
narimiran
1e3bdf04d8 bump Nim version to 1.2.1 2020-04-14 09:30:20 +02:00
Dominik Picheta
f1bf28d5de Fixes issues with dynamic loading OpenSSL. Fixes #13903. (#13919) [backport]
This fixes at least a couple of issues:

* Procs loaded from the DLL being used even when the pointer is nil.
* The actual issue (#13903) which appeared to cause stack corruption on
  Android 7.1.1 with OpenSSL 1.1.1f. The change that fixed this was the
  move to loading the procs in `sslSym`.

(cherry picked from commit 350ee0308a)
2020-04-14 07:30:29 +02:00
Clyybber
078df45e99 Fix #13889 with testcase (#13896) [backport]
* Fix https://github.com/nim-lang/Nim/issues/13889

* Add testcase

* Reduce test time

Co-authored-by: Elie Zedeck RANDRIAMIANDRIRAY <elie.zedeck@gmail.com>
(cherry picked from commit 92c4aad205)
2020-04-14 07:30:06 +02:00
Timothee Cour
adf644d6a4 openDefaultBrowser now works on OSX (#13892) [backport]
(cherry picked from commit e6d870896b)
2020-04-14 07:29:59 +02:00
supakeen
c4dfdb71f4 Add isNil check to custom Content-Length. (#13867) [backport:1.2]
Related to #13866.

(cherry picked from commit 09ca19208f)
2020-04-14 07:29:26 +02:00
narimiran
7e83adff84 bump Nim version to 1.2.0 2020-04-03 14:17:15 +02:00
itsumura-h
87e6b88f3b fix #7241 (#13779)
finalize() should run in insert()
2020-04-03 09:38:05 +02:00
flywind
6b9ffc7fad fix asynchttpserver content-length header (#13846) 2020-04-03 09:05:43 +02:00
Timothee Cour
d23371fdd7 std/byaddr => std/decls (#13847) 2020-04-03 09:03:13 +02:00
Araq
8ee0771b5a return types must not be Natural for reasons I won't outline here 2020-04-02 15:01:14 +02:00
Dean Eigenmann
df8e0e7f0c feature/count (#13837) 2020-04-02 12:09:29 +02:00
Andreas Rumpf
d01245e501 renamed new std/pragmas.nim to std/byaddr.nim (#13844)
* renamed new std/pragmas.nim to std/byaddr.nim

* minor code cleanup
2020-04-02 11:52:31 +02:00
Juan Carlos
c167261735 Deprecate PHP (#13838) 2020-04-02 08:48:09 +02:00
Juan Carlos
160d5fe589 Jsconsole update (#12448)
* Improve jsconsole adding the rest of the stable api as documented on the standard at https://developer.mozilla.org/docs/Web/API/Console

* Improve jsconsole, add runnableexamples
* Simplify jsconsole
2020-04-02 08:47:45 +02:00
Juan Carlos
46ca19ff18 Deprecate DCE:on (#13839) 2020-04-02 02:58:43 +02:00
Juan Carlos
afd0afe0a3 Deprecate when declared(echo):echo (#13840) 2020-04-02 02:56:18 +02:00
Juan Carlos
9102ac8c7d Documentation and Code Style inotify (#13836) 2020-04-02 01:05:55 +02:00
Juan Carlos
9599757068 Add browsers.openDefaultBrowser without URL, implements IETF RFC-6694 Section-3 (#13835) 2020-04-01 15:46:47 -04:00
Juan Carlos
4816984726 Documentation, add more examples (#13825) 2020-04-01 19:39:58 +02:00
Andreas Rumpf
484548c784 revert stdlib changes which are not required anymore 2020-04-01 19:38:44 +02:00
Zahary Karadjov
0521f98486 Hrm, the new errors highlighted some code that seems to be broken
New issue: since `Table[A, B]` allocates its backing storage with
`newSeq[KeyValuePair[A, B]]`, it's no longer legal to create a table
with `not nil` types used as either keys or values.
2020-04-01 19:38:44 +02:00
Araq
48213c7428 encodeMIME should be encodeMime by our coding guidelines 2020-04-01 14:10:27 +02:00
Timothee Cour
fd202136b4 fix #13829 (#13831) 2020-04-01 12:46:59 +01:00
Andreas Rumpf
9ffec79300 DrNim (Nim compiler with Z3 integration) (#13743)
* code cleanups and feature additions
* added basic test and koch/CI integration
* make it build on Unix
* DrNim: now buildable on Unix, only takes 10 minutes, enjoy
* added basic documentation for DrNim which can also be seen as the RFC we're following
* drnim: change the build setup so that drnim.exe ends up in bin/
* makes simple floating point ranges work
* added basic float range check
* drnim: teach Z3 about Nim's range types plus code refactoring
* drnim: make unsigned numbers work
* added and fixed index checking under setLen
* first implementation of .ensures, .invariant and .assume (.requires still missing and so is proc type compatibility checking
* drnim: .requires checking implemented
* drnim: implemented .ensures properly
* more impressive test involving min()
* drnim: check for proc type compatibility and base method compatibility wrt .requires and .ensures
* testament: support for 'pattern <directory>
* koch: uses new <directory> feature of testament
* drnim: added tiny musings about 'old'
* Make testament work with old SSL versions
* koch: add support for 'koch drnim -d:release'
* drnim: preparations for the param.old notation
2020-03-31 22:54:48 +02:00
Juan Carlos
dd44701728 Tiny fix on browsers.openDefaultBrowser (#13818) 2020-03-31 21:22:24 +02:00
Juan Carlos
c6586322ba Fix a 'See XXX' on documentation, clean out (#13820) 2020-03-31 21:21:49 +02:00
Andreas Rumpf
9134bb9cfb macros for proc types, macros for types (#13778)
* new minor feature: macros for proc types, to be documented

* Finished the implementation and added tests

* [skip ci] Describe the new custom pragmas in the manual and the changelog

Co-authored-by: Zahary Karadjov <zahary@gmail.com>
2020-03-31 21:14:05 +02:00
c-blake
b1aa3b1eea Unwind just the "pseudorandom probing" part of recent sets,tables changes (#13816)
* Unwind just the "pseudorandom probing" (whole hash-code-keyed variable
stride double hashing) part of recent sets & tables changes (which has
still been causing bugs over a month later (e.g., two days ago
https://github.com/nim-lang/Nim/issues/13794) as well as still having
several "figure this out" implementation question comments in them (see
just diffs of this PR).

This topic has been discussed in many places:
  https://github.com/nim-lang/Nim/issues/13393
  https://github.com/nim-lang/Nim/pull/13418
  https://github.com/nim-lang/Nim/pull/13440
  https://github.com/nim-lang/Nim/issues/13794

Alternative/non-mandatory stronger integer hashes (or vice-versa opt-in
identity hashes) are a better solution that is more general (no illusion
of one hard-coded sequence solving all problems) while retaining the
virtues of linear probing such as cache obliviousness and age-less tables
under delete-heavy workloads (still untested after a month of this change).

The only real solution for truly adversarial keys is a hash keyed off of
data unobservable to attackers.  That all fits better with a few families
of user-pluggable/define-switchable hashes which can be provided in a
separate PR more about `hashes.nim`.

This PR carefully preserves the better (but still hard coded!) probing
of the  `intsets` and other recent fixes like `move` annotations, hash
order invariant tests, `intsets.missingOrExcl` fixing, and the move of
`rightSize` into `hashcommon.nim`.

* Fix `data.len` -> `dataLen` problem.
2020-03-31 19:18:45 +02:00
Euan
7abeba6aeb #13806 - getApplFreebsd might lose data (#13807)
* #13806 - first call sysctl with a null buffer to get the length, then alloc buffer and call again

* Use csize_t rather than csize

* Suggestions from @Clyybber

Co-authored-by: Euan Torano <euan.torano@bluesky-wireless.co.uk>
2020-03-31 15:50:24 +02:00
Juan Carlos
42d2c3088e Add Documentation (#13811)
* Add more Docs and runnableExamples
2020-03-31 15:47:57 +02:00
Timothee Cour
1e4093d949 refs #13797 (#13812) 2020-03-31 15:43:35 +02:00
Timothee Cour
19cab9fa51 stacktraces can now show custom runtime msgs per frame (#13351)
* stacktraces can now show custom runtime msgs
* improve tests/stdlib/tstackframes.nim
* fix test for --gc:arc
* test --stacktraceMsgs:on and --stacktraceMsgs:off
* --stacktracemsgs:off by default
2020-03-30 13:45:32 +02:00
Timothee Cour
06f8c5cb6f fix #13794 HashSet leak (#13800) 2020-03-29 18:08:50 +02:00
Juan Carlos
8c719fce54 Fix #13631 (#13789) 2020-03-29 14:39:58 +02:00