mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00
DMD Issue 6859 - Segfault when abstract method uses with contract.
This commit is contained in:
parent
edc4a5f003
commit
b41688a0b8
6 changed files with 66 additions and 21 deletions
|
@ -9,6 +9,7 @@
|
|||
#include "template.h"
|
||||
#include "module.h"
|
||||
#include "statement.h"
|
||||
#include "id.h"
|
||||
|
||||
#include "gen/irstate.h"
|
||||
#include "gen/tollvm.h"
|
||||
|
@ -252,6 +253,15 @@ llvm::FunctionType* DtoFunctionType(FuncDeclaration* fdecl)
|
|||
|
||||
Type *dthis=0, *dnest=0;
|
||||
|
||||
#if DMDV2
|
||||
if (fdecl->ident == Id::ensure || fdecl->ident == Id::require) {
|
||||
FuncDeclaration *p = fdecl->parent->isFuncDeclaration();
|
||||
assert(p);
|
||||
AggregateDeclaration *ad = p->isMember2();
|
||||
assert(ad);
|
||||
dnest = Type::tvoid->pointerTo();
|
||||
} else
|
||||
#endif
|
||||
if (fdecl->needThis()) {
|
||||
if (AggregateDeclaration* ad = fdecl->isMember2()) {
|
||||
Logger::println("isMember = this is: %s", ad->type->toChars());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue