D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15257 - __traits(compiles, …) with malformed inline asm silently ends compilation
Summary: __traits(compiles, …) with malformed inline asm silently ends compilation
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P1 normal
Assignee: Cauterite
URL:
Keywords: iasm, pull
Depends on:
Blocks:
 
Reported: 2015-10-29 12:07 UTC by Cauterite
Modified: 2020-08-21 05:36 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 Cauterite 2015-10-29 12:07:22 UTC
https://ideone.com/5tn592

When DMD hits this:
	__traits(compiles, {
		asm {#$%^&*;}
	});
it runs asmerr(…) which is supposed to print the error ( verror(…) ) and exit().
However, because __traits(compiles sets global.gag to 1, verror never prints anything, so the compiler exits with no error message whatsoever.
Comment 1 Vladimir Panteleev 2015-10-30 11:16:38 UTC
Timeline:
2.058: Shows error message
2.059: Segfaults
2.060: Exits silently
Comment 2 Vladimir Panteleev 2015-10-30 11:26:43 UTC
https://github.com/D-Programming-Language/dmd/pull/5244
Comment 3 Cauterite 2015-10-30 11:27:51 UTC
(In reply to Vladimir Panteleev from comment #2)
> https://github.com/D-Programming-Language/dmd/pull/5244

Thanks, not sure why the pull didn't get posted here automatically.
Comment 4 Vladimir Panteleev 2015-10-30 11:38:31 UTC
(In reply to Cauterite from comment #3)
> Thanks, not sure why the pull didn't get posted here automatically.

It's not, you have to post it yourself.

http://wiki.dlang.org/Pull_Requests#Create_a_pull_request
Comment 5 Cauterite 2015-10-30 11:48:32 UTC
(In reply to Vladimir Panteleev from comment #4)
> (In reply to Cauterite from comment #3)
> > Thanks, not sure why the pull didn't get posted here automatically.
> 
> It's not, you have to post it yourself.
> 
> http://wiki.dlang.org/Pull_Requests#Create_a_pull_request

Ah, whoops. I think the wording on that page is a bit ambiguous.
Comment 6 Vladimir Panteleev 2015-10-30 11:49:24 UTC
(In reply to Cauterite from comment #5)
> I think the wording on that page is a bit ambiguous.

It's a wiki, fix it :)
Comment 7 Cauterite 2016-08-19 21:55:54 UTC
New pull request:
https://github.com/dlang/dmd/pull/6068

I could use some help identifying the cause of buggy behaviour introduced by this patch; see: https://github.com/dlang/dmd/pull/6068#issuecomment-240745667
Comment 8 Dlang Bot 2020-08-20 07:07:12 UTC
@WalterBright created dlang/dmd pull request #11597 "fix Issue 15257 - __traits(compiles, .) with malformed inline asm sil…" fixing this issue:

- fix Issue 15257 - __traits(compiles, .) with malformed inline asm silently ends compilation

https://github.com/dlang/dmd/pull/11597
Comment 9 Dlang Bot 2020-08-21 05:36:07 UTC
dlang/dmd pull request #11597 "fix Issue 15257 - __traits(compiles, .) with malformed inline asm sil…" was merged into master:

- 282b81d4ea1f80ad967a69a5dc5c03cb3d2f2c1a by Walter Bright:
  fix Issue 15257 - __traits(compiles, .) with malformed inline asm silently ends compilation

https://github.com/dlang/dmd/pull/11597