Fix issue 18242 - Warn if object.Exception is missing#8050
Fix issue 18242 - Warn if object.Exception is missing#8050dlang-bot merged 5 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request and interest in making D better, @LemonBoy! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
|
|
If |
|
When creating a PR to fix a bugzilla issue, please post a link to the PR in the issue. This is so that someone browsing bug reports will know if and where a PR for it is. I did it for this one. |
Isn’t there a bot that does this automatically? |
Let's try with this other approach then. |
No. |
|
|
I just tested this and it looks good to me. It just needs a test case. |
| @@ -0,0 +1,15 @@ | |||
| // REQUIRED_ARGS: -c | |||
There was a problem hiding this comment.
If you add DFLAGS: (without anything following it) it will prevent all the default flags for importing the runtime, etc.. from being added implicitly to compiler invocation. Then you shouldn't need to declare the TypeInfo stuff and have to deal with all the object mismatch errors.
See #7845
There was a problem hiding this comment.
Sorry, Ignore the comment above. It appears TypeInfo is required because Throwable has been declared. This should get you passed the 32-bit tests:
module object;
class Object { }
class Throwable { }
class TypeInfo { }
class TypeInfo_Class : TypeInfo
{
version(D_LP64)
{
ubyte[136] _x;
}
else
{
ubyte[68] _x;
}
}
int _d_run_main()
{
try { } catch(Throwable e) { return 1; }
return 0;
}There was a problem hiding this comment.
Thanks for the hint, I always forget about 32bit platforms.
test/compilable/b18242.d
Outdated
|
|
||
| class TypeInfo { } | ||
| class TypeInfo_Class : TypeInfo { | ||
| version(D_LP64) { ubyte[136] _x; } else { ubyte[68] _x }; |
There was a problem hiding this comment.
I think you need to remove the semicolon at the end of this line, and put it after the _x.
There was a problem hiding this comment.
I modified it (though I misspelled fix in the commit message) 😢
Let's not segfault if no
Exceptionclass is defined.