Commit graph

914 commits

Author SHA1 Message Date
Dennis
3945e81615
Fix #20907 - DMD segfaults with static array length parameter derived from left-shifted template parameter property (#20919) 2025-02-28 21:46:10 +01:00
Dennis
34cf3a9503
Fix #20894 (#20895)
- pragma(msg) interprets printf format specifiers
2025-02-19 13:42:21 +08:00
Dennis Korpel
eb083c06d9 Fix #20859 - ICE: class with __vtbl field name causes segfault in Scope::inCfile 2025-02-16 23:45:36 +01:00
Dennis
72a9347165
Fix #18281 - ICE on attempt to compare deref of two functions ptr (#20768) 2025-01-24 07:32:18 +08:00
Dennis
ac9e8a5a70
Fix bypassing nothrow in debug statements (#20720)
* Fix bypassing nothrow in debug statements

* Fix debug walking null statements
2025-01-17 01:50:17 +01:00
Dennis
b237d0329c
Fix ambiguous type deduction around hex strings (#20679) 2025-01-10 23:35:51 +01:00
Ilya Yanok
c1343f69f3 Make lambda symbols stable post a3abf1187e
Commit a3abf1187e fixes some cases of
lambdas having unstable symbol names between compilation units by
using `generateIdWithLoc` to generate stable lambda names, however since
LOC doesn't uniquely identify a lambda instance (because templates,
mixins, static foreach and foreach unrolling), `generateIdWithLoc`
adds a counter, so there is still some instability going on.

`generateIdWithLoc` makes the name uniq per file+loc, by adding adding a
numeric suffix. But the order of instantiations might be different
across compilation units, so with this counting scheme we are back to
unstable names, so one module might have

`t!0.__lambda_LOC` and
`t!1.__lambda_LOC_1`

while another one has

`t!1.__lambda_LOC`

This is not a critical problem, but at very least the code gets
duplicated for no reason. I also have an example where it leads to
linking error, but since it's not a small one and fails to minimize
further, I suspect it's a result of interaction with some other bug.

The thing is we don't even need uniqueness for those lambdas inside
templates/mixins: their final names will have the instantiation prefix anyway.
But we can't also just disable this uniqueness check completely: `static
foreach` as well as unrollings of the normal `foreach` with lambdas in
the loop body will have several copies of a single lambda with the same
file+loc. So here we do want to keep making them unique. Fortunately, I
don't think a `foreach` could be iterated in different order in
different compilation units, so hopefully if we limit the counting to
this case only, it won't make symbols unstable.

To implement this idea, I've added an extra `parent` argument to
`generateIdWithLoc`: it works like using `parent ~ prefix` prefix, but
without adding `parent` to the final output.

Fixes since last review:
 1. Changed `fromStringz` to `toDString`
 2. Added a test to showcase the problem
2024-12-07 10:48:34 +01:00
Richard (Rikki) Andrew Cattermole
6567f6f4a4 Fix bugzilla issue 24882 - COM class is allocated using GC not malloc 2024-11-29 08:37:07 +01:00
Dennis Korpel
8b1eb80d25 Fix bugzilla 24884 - backend generates wrong 32-bit code after inlining math with double[4] 2024-11-29 08:35:16 +01:00
Dennis
a3abf1187e
Fix 23722 - Lambdas are mangled incorrectly when using multiple compi… (#15343)
* Fix 23722 - Lambdas are mangled incorrectly when using multiple compilation units, resulting in incorrect code

* Update test cases
2024-11-27 12:03:16 +01:00
Martin Kinkelin
c58e2a766b compilable/stdcheaders.c: Work around unsupported NAN in new WinSDK headers
GitHub Actions upgraded the WinSDK in the latest image, and its NAN is
apparently not supported by ImportC anymore, breaking CI.
2024-11-16 22:08:33 +01:00
Richard (Rikki) Andrew Cattermole
a7c85ec3be Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess 2024-11-11 05:39:57 +08:00
Walter Bright
735193cc36 fix bugzilla Issue 24819 - Optimizer changes result of float calculations on 32-bit (#17023)
(cherry picked from commit 88d1e8fc37)
2024-10-25 01:47:41 +02:00
Dennis
d0eb6bb659
Fix bugzilla 24832 - Segfault in hex string (#17024)
* Fix bugzilla 24832 - Segfault in hex string

* Fix lack of camelcasing on stable branch
2024-10-24 19:45:57 +02:00
Nicholas Wilson
b97828fef4
Fix bugzilla issue 24812 - Incorrect highlighting when diagnosing an empty enum declaration (#17004) 2024-10-14 13:03:17 +02:00
Dennis
3f48f53e27
Fix bugzilla 24431 - dmd -vcg-ast crashes printing failed template in… (#16916) 2024-10-04 07:47:09 +08:00
Dennis
e0259d92e7
Fix bugzilla 24764 - ICE when -vcg-ast prints imported invariant (#16917)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-10-03 13:47:19 +02:00
Dennis
f420f988ab
Fix bugzilla 24790 - -vcg-ast ICE on lowered assign exp (#16914)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-10-03 13:46:41 +02:00
RazvanN7
219b4f07e4 Fix Bugzilla Issue 24760 - ICE on variadic after default argument 2024-09-12 10:10:24 +02:00
Dennis
96d630c644
Fix bugzilla 24731 - IFTI cannot handle integer expressions (#16822) 2024-08-31 21:20:35 +08:00
Dennis Korpel
636f4d3ba2 Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument 2024-08-15 00:47:47 +02:00
Dennis
e643a07ebc
Also make deprecationSupplemental adhere to error limit (#16779)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-08-13 23:23:09 +02:00
RazvanN7
29a34181da Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore 2024-08-06 02:07:42 +02:00
Dennis
cf618a659c
Fix bugzilla 24337 - Segfault when printing an int[] cast from a string (#16729) 2024-07-22 11:00:31 +03:00
Martin Kinkelin
7ab98b931a
Fix Bugzilla 24599 - Wrongly elided TypeInfo emission (#15868)
Reverting #14844, which caused such missing TypeInfos, *and* making
sure the special TypeInfo members are fully analyzed and ready for
codegen (otherwise hitting an assertion for the real-world project).
2024-07-02 19:31:34 +02:00
The Dlang Bot
66b93fc24a
Merge pull request #16642 from ibuclaw/merge_stable
merge stable

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-07-01 16:52:47 +02:00
Iain Buclaw
3c5d12bd1f Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-07-01 13:58:42 +00:00
Dennis Korpel
25f26e2bdf Treat import("file") as hex string 2024-07-01 01:21:36 +02:00
Johan Engelen
b5130fd880 Fix bugzilla issue 24623 followup.
Rename CppRuntime to _LLVM and _GNU
Also accept c++ for cxx in target string.
2024-06-30 13:45:31 +02:00
Nick Treleaven
be5dd7c25e [trivial] Fix foreach range tuple element error message 2024-06-28 15:59:30 +02:00
Nick Treleaven
74618abad1 Fix Bugzilla 24631 - Pointer cast allows changing @system field in @safe code 2024-06-26 15:29:49 +02:00
Nick Treleaven
5058aa95fe Fix Bugzilla 24630 - Casting a bool pointer to a mutable pointer type is unsafe 2024-06-26 01:05:08 +02:00
Nick Treleaven
e96efa0db1 Tweak message for unsafe cast to bool array/pointer
Add test for cast to `bool*`.
See https://issues.dlang.org/show_bug.cgi?id=24582.
2024-06-23 15:08:31 +02:00
Tim Schendekehl
557e1d5eea
Fix bugzilla 24594 - ImportC: Packed struct has wrong layout (#16611)
Packed structs were already implemented with the Microsoft syntax
(e.g. `#pragma pack(push, 1)`), but the GCC syntax was ignored.
2024-06-22 20:48:09 +08:00
Johan Engelen
0e174c920f Fix d_do_test for older host compiler without this PR. 2024-06-22 12:42:31 +02:00
Johan Engelen
349b493810 Fix bugzilla issue 24623: Rename CppRuntime_Clang/Gcc to CppRuntime_libcpp/libstdcpp. Add libcpp and libstdcpp -target= option recognition. 2024-06-22 11:55:11 +02:00
Nick Treleaven
3949a4dd3b
Fix Bugzilla 24622 - Modify const data with void[] concatenation/append (#16606) 2024-06-21 18:57:47 +03:00
Nick Treleaven
15f66f89c9 Fix Bugzilla 12885 - const union wrongly converts implicitly to mutable 2024-06-20 12:04:11 +02:00
Dennis
c0fcaa0e96
Fix bugzilla 24583 - di generator emits return scope and scope return in wrong order (#16595) 2024-06-18 17:12:59 +03:00
Dennis Korpel
3e92cca51d Fix Bugzilla 24602 - Internal compiler error: failed to detect static initialization of associative array 2024-06-18 01:24:34 +02:00
Nick Treleaven
c6058f9b76
Fix Bugzilla 17148 - Copying from const(void)[] to void[] breaks immu… (#16583) 2024-06-17 17:11:52 +08:00
Tim Schendekehl
4c82050e94 Fix bugzilla 24592 - ImportC: Bitfield layout wrong for int64 on 32-bit Linux
Type ulong is 64-bit on 32-bit Linux, but has 32-bit alignment.
This affects the layout of bitfields.

Also add a new test for ImportC bitfields, which compares size,
alignment and layout with the host C++ compiler. The existing
tests compared with fixed values instead.
2024-06-17 02:31:02 +02:00
Iain Buclaw
515f395d28
Merge pull request #16589 from ibuclaw/merge_stable
merge stable
2024-06-16 09:36:47 +02:00
Nick Treleaven
8d7839a9d9 Fix Bugzilla 24603 - Can copy from non-void array into void[] in safe code
Deprecate in safe code.
2024-06-16 08:59:16 +02:00
Iain Buclaw
ebf03eb3ca Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-06-15 22:32:47 +00:00
Nick Treleaven
bed5228567 Add supplemental messages to explain unsafe casts
Change msg parameter to use `ref`.
Add test for existing extern(C++) interface cast error.
Add test for class qualifier cast in @safe code.
Add test for casting with opaque array element type.
2024-06-14 02:57:58 +02:00
Nick Treleaven
23e6712446
Fix Bugzilla 24582 - Detect unsafe cast(bool[]) (#16558)
Allow literal cast

Make deprecation

Add specific supplemental message
2024-06-13 11:23:34 +02:00
Nick Treleaven
295b0008e4
Fix Issue 23957 - Casting to derived extern(C++) class is unsafe (#15294)
Fix Issue 23957 - Casting to derived extern(C++) class is unsafe

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-06-12 13:49:50 +02:00
Martin Kinkelin
83b62e9633 Add test case for Bugzilla 24590 2024-06-11 14:37:48 +02:00
Brian Callahan
a3eb99191d Fix Bugzilla 24598 2024-06-11 07:20:29 +02:00