mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-29 06:30:39 +03:00
Fix detection of special reference variables
D2.072 apparently doesn't set the STCforeach storage class for each special reference anymore. So let's consider all references which aren't parameters, i.e., all locals with STCref, as special references. By-ref parameters are different as we simply use the LL pointer parameter as lvalue for the variable, no extra alloca required. Special references are automatically dereferenced pointers and as such occupy a dedicated alloca for the address.
This commit is contained in:
parent
de0708e99b
commit
9d4961ae27
1 changed files with 1 additions and 1 deletions
|
@ -1392,7 +1392,7 @@ void callPostblit(Loc &loc, Expression *exp, LLValue *val) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool isSpecialRefVar(VarDeclaration *vd) {
|
||||
return (vd->storage_class & STCref) && (vd->storage_class & STCforeach);
|
||||
return (vd->storage_class & (STCref | STCparameter)) == STCref;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue