Bug 22253 – ImportC expressions inadvertently supporting D properties

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-08-30T04:21:14Z
Last change time
2021-09-30T01:46:03Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
mhh

Comments

Comment #0 by maxhaton — 2021-08-30T04:21:14Z
Example 1: --- char* strcpy(char* destination, const char* source); int puts(char*); int main() { char staticArray[256]; strcpy(staticArray.ptr, "mhh is allergic to pollen"); puts(staticArray.ptr); <- .ptr ! char* copy = staticArray.dup.ptr; <-- Crossing streams... } --- Example 2: --- struct Value { int state; }; int main() { struct Value x; struct Value y = {0}; x.init = y; } --- Example 3: --- void use(int state, float monkey); struct Value { int state; float monkey; }; int main() { struct Value x = {0, 3.14}; use(x.tupleof); } ---
Comment #1 by dlang-bot — 2021-09-14T07:40:57Z
@WalterBright updated dlang/dmd pull request #13066 "https://dlang.org/spec/expression.html#cat_expressions" fixing this issue: - fix Issue 22253 - ImportC expressions inadvertently supporting D properties https://github.com/dlang/dmd/pull/13066
Comment #2 by dlang-bot — 2021-09-14T08:23:07Z
dlang/dmd pull request #13066 "fix Issue 22253 - ImportC expressions inadvertently supporting D properties" was merged into stable: - 0733ba83f7c81b1f2393c1572582dd1c88edc065 by Walter Bright: fix Issue 22253 - ImportC expressions inadvertently supporting D properties https://github.com/dlang/dmd/pull/13066
Comment #3 by dlang-bot — 2021-09-30T01:46:03Z
dlang/dmd pull request #13108 "merge stable" was merged into master: - 602d0b135b2b59f988591851117e058733b45e06 by Walter Bright: fix Issue 22253 - ImportC expressions inadvertently supporting D properties https://github.com/dlang/dmd/pull/13108