Bug 17990 – Type.toChars() returns null and Type.size() returns nonsense on 32-bit platforms only
Status
RESOLVED
Resolution
INVALID
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2017-11-18T06:50:52Z
Last change time
2017-11-18T11:49:40Z
Assigned to
No Owner
Creator
Mike Franklin
Comments
Comment #0 by slavo5150 — 2017-11-18T06:50:52Z
This bug was found in this PR (https://github.com/dlang/dmd/pull/7332)
in this code:(https://github.com/JinShil/dmd/blob/1cf383600f21394b12e2077ae97c4944f53c5e2b/src/ddmd/expressionsem.d#L7622-L7636)
On 32-bit platforms `p2.toChars()` always returns null and `p2.size()` returns nonsense. On 64-bit platforms they're fine.
For example, the error message always appears like this on 32-bit platforms:
Deprecation: Operands point to types of different size; void (1 bytes), (null) (158464776 bytes).
It should appear like this (as it does on 64-bit platforms):
Deprecation: Operands point to types of different size; void (1 bytes), ulong (8 bytes).
See the results of the auto-tester in the aforementioned PR for more details.
Comment #1 by slavo5150 — 2017-11-18T11:49:40Z
Actually, after looking into this, it Type.toChars() and Type.size() are returning the correct values. The problem appears to be with the `deprecation()` function and variable format arguments. Will post a separate issue when more information is gathered.