Commit Graph

96 Commits

Author SHA1 Message Date
LemonBoy
a1083d7c43 Fix codegen for some set operations
Taking the LHS type when a temporary result value was needed lead to bad
code being generated if we get a tyRef.

Fixes #9098
2018-09-28 09:59:45 +02:00
Andreas Rumpf
179791aa9a Merge pull request #8746 from LemonBoy/nil-opts
nil strings are movable
2018-09-23 07:51:22 +02:00
LemonBoy
7a087ffb29 nil strings are movable 2018-09-22 20:47:49 +02:00
Andreas Rumpf
c661f8e1be Merge pull request #8983 from cooldome/codegen_crash
Fixes 8979
2018-09-18 09:36:16 +02:00
Andrii Riabushenko
acaf2b8e76 Fixes 8979 2018-09-16 21:33:21 +01:00
LemonBoy
6af6ca6351 Fix codegen for set[T] parameters
Sometimes sets are materialized as arrays and we must treat them as
such: the CPP backend is pickier than the C one and would sometimes
produce invalid code.

Fixes #8967
2018-09-15 11:55:11 +02:00
LemonBoy
839953c3e1 Fix hashing for codegenProc (sic) types
Since the name mangling is inhibited we should take the user-supplied
name during the sighash computation.

Fixes #8964
2018-09-14 15:37:51 +02:00
LemonBoy
8670f4911b Fix semantic pass with borrowed magic procs (#8945)
Reported by pqflx3 on the forum.
2018-09-11 20:32:25 +02:00
LemonBoy
e7d4043406 Always emit hti object types if needed (#8940)
The compiler is now smart enough to emit types only if needed without
all the importc tricks. This also fixes a codegen bug where, if all the
stars align correctly, typeinfo doesn't include any definition of
`TNimType` but uses it.

Found by @skilchen in #8938
2018-09-11 17:03:21 +02:00
LemonBoy
e81fe6d32f Allow wCodegenDecl on lambdas (#8892) 2018-09-07 01:58:49 +02:00
LemonBoy
4aba2981dd Codegen fix for function pointers marked inline (#8866)
Fixes #5345
Fixes #5701
2018-09-04 15:28:14 +02:00
Vindaar
52f03fabc1 fixes #8781 by appending "_U" instead of 'U' (#8787) 2018-08-27 08:35:07 +02:00
Araq
27f488e5d9 make more tests green; system.repr does not produce 'nil' for strings and seqs anymore 2018-08-22 15:37:57 +02:00
LemonBoy
c04404635b Fix unsound transform pass (#8633)
When a `var openArray[T]` function parameter goes trough the
`transformAddrDeref` pass we may lose the `var` specifier, leading to
nasty crashes at runtime.
2018-08-14 20:38:04 +02:00
LemonBoy
3cb963f114 Fixes 8616 (#8617)
* Don't leave dangling forward references to types

Fixes #8616

* Add a test case for #8616
2018-08-12 20:43:30 +02:00
cooldome
e2c2ae8e7e fixes #7392 (#7395) 2018-03-23 13:28:22 +01:00
cooldome
23230572e2 Fixes #7363 (#7371) 2018-03-20 11:14:47 +01:00
cooldome
70b28a39fe Codegen: use type forward declarations more aggresively. Fixes #7339 (#7340)
Do not emit object definition it if used only by ref or ptr
2018-03-16 16:21:03 +01:00
andri lim
4f9f9ea528 fixes #7332 (#7341) 2018-03-16 15:32:01 +01:00
Andreas Rumpf
358709e9cb fixes #6960 2018-02-11 13:55:56 +01:00
GULPF
94038545be Fixes codegen bug with literal negative zero, fixes #7079 (#7158)
* Fixes #7079

* Fix handling of neg zero during constant folding
2018-01-31 16:29:42 +01:00
Araq
a5e4d2f7a3 fixes #668 2017-12-15 11:21:49 +01:00
Fabian Keller
6df6ec27ec Improved collection-to-string behavior (#6825) 2017-12-14 14:02:13 +01:00
Andreas Rumpf
f70d967d2c fixes #6889 2017-12-08 23:31:06 +01:00
Araq
eae1aaa377 fixes another sighashes problem 2017-12-08 10:06:20 +01:00
Anatoly Galiulin
c343303efe Fix usage of parameters types in templates #6756 (#6768) 2017-11-29 01:34:30 +01:00
Andreas Rumpf
d072229975 fixes #6724 2017-11-19 00:37:36 +01:00
Andreas Rumpf
129a599cd6 fixes #6422 2017-10-26 12:23:37 +02:00
Andreas Rumpf
9485f1c888 make tests green again 2017-10-16 20:29:16 +02:00
Andreas Rumpf
920f4acadf fixes #6279 2017-08-29 00:33:46 +02:00
Andreas Rumpf
88b65ea957 fixes #6234 2017-08-11 20:14:44 +02:00
Arne Döring
000b8afd26 Remove expr/stmt (#5857) 2017-07-25 09:28:23 +02:00
zah
1d6018726e fix #5296 (#5565) 2017-03-19 20:33:21 +01:00
Araq
fb37d13f46 fixes #5439 2017-02-26 17:41:00 +01:00
Araq
dd8cbf5fca fixes #5404 2017-02-17 17:44:52 +01:00
Araq
6499462303 fixes #5402 2017-02-16 11:15:43 +01:00
Andreas Rumpf
5ff6ff28bf fixes #5339 2017-02-09 01:16:43 +01:00
Andreas Rumpf
56aa1ac5bc new name mangling scheme implemented 2017-02-02 10:30:01 +01:00
Brandon Pickering
9f95dd8e1d Create temp var in deepcopy if needed (#5205) 2017-01-15 06:26:59 +01:00
Brandon Pickering
da1293c405 Reset exprs before return by arg. Fixes #5098 (#5191) 2017-01-11 06:24:31 +01:00
Araq
4104ee121d fixes #5147 2016-12-30 00:59:10 +01:00
Andreas Rumpf
7bd473c59b fixes #5137 2016-12-22 09:13:22 +01:00
Araq
34143ee122 fixes serious codegen regression that caused Nimble to misbehave 2016-12-10 02:30:57 +01:00
Araq
8494338bcb fixes #5055 2016-11-30 22:25:56 +01:00
Araq
7b44896e03 fixes #5079 2016-11-30 21:10:22 +01:00
Andreas Rumpf
b78029b5af fixes #4626 2016-09-13 16:33:43 +02:00
Andreas Rumpf
08a6f3fc67 fixes #4721 2016-09-07 08:29:45 +02:00
Andreas Rumpf
18e37cad08 fixes #4653 2016-08-24 11:48:21 +02:00
Andreas Rumpf
440ed8eb68 fixes #4551 2016-08-09 14:16:26 +02:00
Andreas Rumpf
baeec11808 fixes #4354 2016-08-04 23:34:58 +02:00