[Issue 20778] New: exception messages with nulls within are treated inconsistently

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 28 01:44:12 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=20778

          Issue ID: 20778
           Summary: exception messages with nulls within are treated
                    inconsistently
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody at puremagic.com
          Reporter: elpenguino+D at gmail.com

```
throw new Exception("hello\0world!");
```
As of DMD 2.091.1, the printed message is inconsistent between platforms. On
windows, the full string is printed. on other platforms, only "hello" is
printed.

I would expect the entire string to be printed in all cases, but it seems some
code in druntime expects the latter case instead (see
core.internal.array.casting.onArrayCastError, for example).

This inconsistency appears to have been introduced between 2.064 and 2.065,
when the default exception printer was changed from using write() to fprintf()
on non-windows platforms.

--


More information about the Digitalmars-d-bugs mailing list