D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 8652 - dmd make calls to _d_assertm
Summary: dmd make calls to _d_assertm
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-13 15:34 UTC by jens.k.mueller
Modified: 2022-09-08 09:07 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jens.k.mueller 2012-09-13 15:34:59 UTC
When you use assert you get different output depending on whether a message was given or not.
The reason is that dmd calls _d_assertm if no message was given and _d_assert_msg if a message was given.
This is all fine except that when calling _d_assertm instead of the filename the module name is used. In glue.c around line 478 when calling _d_assertm only the line number is computed. In my opinion _d_assertm should be changed to accept a string for the filename instead of a ModuleInfo*.

I would like to make the needed changes myself but I need assistance because I'm quite lost in the backend/glue code.
Comment 1 RazvanN 2022-09-08 09:07:15 UTC
```
void main()
{
    assert(0);
}
```
Result: core.exception.AssertError@test.d(3): Assertion failure

```
void main()
{
    assert(0, "le message");
}
```

Result: core.exception.AssertError@test.d(3): le message

Seems to be fixed.