From e31957dcd809a26d5742b1d8285da4f1b08f9567 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Wed, 3 Jun 2009 13:11:01 +0200 Subject: [PATCH] Change the frontend generated assert(this) or assert(&this) in D2 to set the ThisExp::var field. --- dmd2/func.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dmd2/func.c b/dmd2/func.c index ada11046..369c33c0 100644 --- a/dmd2/func.c +++ b/dmd2/func.c @@ -1052,8 +1052,11 @@ void FuncDeclaration::semantic3(Scope *sc) } else { // Call invariant virtually - Expression *v = new ThisExp(0); - v->type = vthis->type; + ThisExp *tv = new ThisExp(0); + tv->type = vthis->type; + tv->var = vthis; + Expression* v = tv; + #if STRUCTTHISREF if (ad->isStructDeclaration()) v = v->addressOf(sc); @@ -1321,8 +1324,11 @@ void FuncDeclaration::semantic3(Scope *sc) } else { // Call invariant virtually - Expression *v = new ThisExp(0); - v->type = vthis->type; + ThisExp* tv = new ThisExp(0); + tv->type = vthis->type; + tv->var = vthis; + Expression *v = tv; + #if STRUCTTHISREF if (ad->isStructDeclaration()) v = v->addressOf(sc);