LemonBoy
e89aaaeaab
Open a new scope for static: expr blocks ( #10649 )
...
Bring this in line with how plain blocks are analysed and avoids codegen
errors if one references variables defined in such a block.
2019-02-23 12:05:07 +01:00
LemonBoy
71df1b060b
Tighten the conversion from tyRange to scalar types ( #10495 )
...
* Tighten the conversion from tyRange to scalar types.
Introduce the `isIntConv` rule for unsigned types.
Do not allow mixed-signedness conversions between ranges and scalar types.
* More json adjustments
2019-02-23 11:52:52 +01:00
Andreas Rumpf
7ec187a8e1
make the VM aware of tyOwned
2019-02-23 11:31:31 +01:00
Timothee Cour
adbabf145c
FFI at CT ( #10150 )
...
* enable FFI at CT
* rename useFFI=>nimHasLibFFI; improve formatting rawExecute traceCode
* disable libffi on windows (works for win32, not yet win64)
2019-02-23 11:31:01 +01:00
Arne Döring
30ab7e6bdd
fixes #10678 ( #10681 )
2019-02-23 10:58:40 +01:00
Andreas Rumpf
ea409fb15a
first steps in implementing 'owned' pointers; undocumented, do not use
2019-02-23 08:44:08 +01:00
Andreas Rumpf
721bf7188b
code cleanup: there is no tyOptRef
2019-02-22 19:42:11 +01:00
Andreas Rumpf
15c208cd29
it's spelt callsite
2019-02-22 18:28:49 +01:00
Andreas Rumpf
a4543c1aac
gc:destructors: make strutils compile (but still crashes)
2019-02-22 12:06:30 +01:00
Andreas Rumpf
417d27c544
gc:destructors: progress
2019-02-21 12:19:06 +01:00
Andreas Rumpf
43d570c178
gc:destructors: make system/repr compile
2019-02-21 07:57:29 +01:00
Araq
6c10d331db
gc:destructors: slightly more stuff compiles
2019-02-20 14:29:18 +01:00
Andreas Rumpf
c025786b75
gc:destructors: sink parameters need to be destroyed properly
2019-02-20 02:04:58 +01:00
Andreas Rumpf
7e404c670d
gc:destructors: add first test program
2019-02-19 23:32:41 +01:00
Araq
f31d1fa98b
fixes #10195
2019-02-19 16:25:57 +01:00
Arne Döring
6b9a139f7f
error message for accidental use of macro ( #10490 )
...
* error message for accidental use of macro
2019-02-19 12:21:42 +01:00
Araq
257965e105
fixes 10697 [backport]
2019-02-19 11:56:14 +01:00
Andreas Rumpf
2deb1e354f
fixes #10702 ( #10705 )
...
* --define:nimQuirky exception handling for Nim; in preparation of a blog post
* make it work with latest system.nim
* make code more readable
* fixes #10702
2019-02-18 15:23:05 +01:00
LemonBoy
cf32d61fa5
Prevent crash on pragma templates w/ generics ( #10685 )
...
* Prevent crash on pragma templates w/ generics
* Remove incorrect call to pragma reconversion
`semOverloadedCall` may return a node with more elements than the
original nkCall node had (implicit and/or explicit generics).
2019-02-18 12:17:00 +01:00
Araq
b081eb4d6d
fixes #10651
2019-02-14 15:55:38 +01:00
Timothee Cour
9913cef872
fix typo in codeReordering error msg ( #10667 )
...
* fix typo in codeReordering
* reorder=>codeReordering
2019-02-14 09:52:15 +01:00
alaviss
3520253a09
compiler/types: correctly generates signature for non-proc types ( #10658 )
...
This makes signatures generated for nimsuggest correctly distinguish
template/macro/converter from proc.
2019-02-13 08:07:58 +01:00
Arne Döring
6870345cd2
32 bit fixes ( #10608 )
2019-02-12 22:00:31 +01:00
Arne Döring
0e5d4f1036
reduce debug output ( #10638 )
2019-02-12 08:27:38 +01:00
LemonBoy
1d1360496f
Fix codegen problem with strict C++ compilers ( #10639 )
...
Since tyCString is convertible to a tyPointer we must be extra careful
to emit a cast to (void*) in order to appease clang++.
Reported by masnagam on the Nim forum.
2019-02-12 08:23:24 +01:00
LemonBoy
5fd9bf9cd5
Propagate tfGcSafe flag to generic instantiations ( #10620 )
...
Fixes a nasty endless loop in the generic instantiation phase.
2019-02-10 22:07:50 +01:00
Timothee Cour
4910608394
revive #10228 ( fix #9880 ) ( #10610 )
...
* Make index out of bounds more useful by including the 'bounds'.
* fixes #9880 index out of bounds (remaining cases); revives #10228
* change err msg to: `index 3 not in 0 .. 1`
2019-02-10 22:07:11 +01:00
Andreas Rumpf
f0e6becc23
fixes #10547
2019-02-10 17:03:32 +01:00
LemonBoy
0c4d1fd10b
Do not walk into type sub-nodes for cast/conv expr ( #10616 )
2019-02-09 19:55:26 +01:00
Andreas Rumpf
c6fdf93c7f
fixes #6955
2019-02-09 11:18:21 +01:00
Andreas Rumpf
3c909ae8ff
fixes #10606
2019-02-09 08:18:33 +01:00
Arne Döring
594c2576e6
Print missing case labels ( #10600 )
2019-02-09 07:36:30 +01:00
Andreas Rumpf
444f2231c9
make tests green again
2019-02-08 16:54:12 +01:00
LemonBoy
aa6e40abe6
Fix wrong result in tuple assignment ( #9340 )
...
Fixes #9177
2019-02-08 12:24:03 +01:00
Araq
4ed7507cb2
error messages can have spaces, don't be dyslexic
2019-02-08 12:18:42 +01:00
LemonBoy
710cfcecd3
Rework exception handling in the VM ( #10544 )
...
* Rework exception handling in the VM
Make the safepoint handling more precise and less forgiving.
The new code is clearer and more commented.
Perform cleanup on `return`.
The no-exception-thrown case in a try block should be slightly faster
since we don't parse the whole set of exceptions every time.
More tests.
* Fix silly error that broke a few tests
* Testament doesn't like files having the same name
* Remove test case that failed compilation to js
2019-02-08 11:57:47 +01:00
LemonBoy
631a8ab57f
Fix edge case in type hashing ( #10601 ) [backport]
...
Empty types introduced by a template produced the same hash of the
"clean" type sharing the same name.
2019-02-08 09:56:32 +01:00
LemonBoy
6b88ce3384
Stop useless suggestion of unsafeAddr ( #10598 )
...
Fixes #10594
2019-02-08 08:59:38 +01:00
alaviss
2fdf816332
compiler/[msgs, suggest]: improve highlighter accuracy ( #10496 )
...
Previously the compiler would generate suggestions based on the symbol
identifier length, but that might not reflect the actual representation
of it within the actual source code.
This commit implements a simple source scanner for the suggest module to
address the problem outlined above.
Fixes nim-lang/nimsuggest#24
2019-02-07 17:08:15 +01:00
LemonBoy
29fbf111a8
Fix codegen when debugger is enabled ( #10595 )
...
Decrement the frame length before closing the parent scope.
Fixes #10589
2019-02-07 17:07:35 +01:00
LemonBoy
f23b0a7dc8
Fix handling of reraise in effect tracking ( #10582 )
...
This is the MVP in order not to get a completely useless error message
from the compiler.
Fixes #10579
2019-02-07 17:07:03 +01:00
Araq
84d10f7d8a
fixes #10585
2019-02-07 15:04:05 +01:00
Araq
d5da450100
helpers2 now has a real name
2019-02-07 12:12:20 +01:00
Andreas Rumpf
2851f316f6
ignore nkCommentStmt in lambda lifting
2019-02-06 22:00:16 +01:00
Andreas Rumpf
4338f86acb
fixes some bug
2019-02-06 22:00:16 +01:00
LemonBoy
294b2e03b2
Reject assignments with nkEmpty RHS ( #9000 )
...
Fixes #8997
2019-02-06 21:26:55 +01:00
LemonBoy
864c3e874c
Merge pull request #10577 from zielmicha/fix-10568
...
Fixes #10568 : Fix null pointer dereference in address computation for incrSeqV3.
2019-02-06 14:23:24 +01:00
LemonBoy
6c8dee4180
Avoid evaluating macros twice in type sections ( #10550 )
...
Fixes #10548
2019-02-06 11:35:44 +01:00
Michał Zieliński
580f62220c
Fixes #10568 : Fix null pointer dereference in address computation.
...
According to https://hownot2code.com/2016/08/18/null-pointer-dereferencing-causes-undefined-behavior/ this was an undefined behaviour.
2019-02-06 10:13:44 +01:00
LemonBoy
4c3f841212
Do not raise ProveInit/WanrUninit for .noinit. var ( #10566 )
2019-02-06 09:14:09 +01:00